Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public with sharing class TempConverterWithConstructor {
- private Decimal celsius;
- public TempConverterWithConstructor(){
- System.debug('Olá Mundo');
- }
- public TempConverterWithConstructor(String msg){
- System.debug(msg);
- }
- public TempConverterWithConstructor(Decimal temp){
- this.celsius = temp;
- }
- public Decimal converteTemp(){
- return this.celsius*1.8 + 32;
- }
- }
- //ANONYMOUS
- /*
- * TempConverterWithConstructor tcwc = new TempConverterWithConstructor(22);
- System.debug(tcwc.converteTemp());
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement