You need to sign in to do that
Don't have an account?
rushi ettam 7
Purpose of return statement
I mentioned my return type as Contact in my method
until you specify that Contact record with DML statement it won't save to database
and if you won't specify systm.debug , we can't see the output in debug log
But if you are not using the DML statment and system.debug
How &&Where can you use the returned values from any method in apex class???????
until you specify that Contact record with DML statement it won't save to database
and if you won't specify systm.debug , we can't see the output in debug log
But if you are not using the DML statment and system.debug
How &&Where can you use the returned values from any method in apex class???????
But, I didn't understand your confusion abour DML statements and system.Debug and how it relates to return statement. Debug satetments are used for debugging. When you want to see the value of a varible at runtime, you can use debug statements. And DML is used for performing DML operations like insert, delete, update and upsert.
Thanks
But why cant we print System.debug(Method1)/System.debug(Method1()),Since method1 returning string of 'Sample code'