You need to sign in to do that
Don't have an account?

what is the difference between object.get(Fieldname) and object.fieldname
scope is list of records from start method of batch which are passed to execute method.
for(SObject obj : scope)
{
String fieldValue='';
for(String fieldName : queryFields)
{
fieldValue = fieldValue +','+ obj.get(fieldName);
}
}
does it work if we sue obj.fieldName
for(SObject obj : scope)
{
String fieldValue='';
for(String fieldName : queryFields)
{
fieldValue = fieldValue +','+ obj.get(fieldName);
}
}
does it work if we sue obj.fieldName
That method of using chain dot notation saves us from writing more code and it saves space in our computer’s memory because we aren’t allocating another variable in memory.
https://medium.com/modernnerd-code/java-for-humans-methods-dot-notation-51077bab55e1