Prakhar Khandelwal :
Let suppose i have a method
public int dummy(){
return 1;
}
and if i call this method by
dummy();
not
int a = dummy();
will it make any difference? why?
Prashant Pandey :
No, it wouldn't make any difference. We call a ton of methods from the JDK ignoring their outputs - List's .remove(int index)
removes the element at a given index, and returns what element was removed. It is normal to ignore it and move ahead.