difference between void and non void methods in java

Solutions on MaxInterview for difference between void and non void methods in java by the best coders in the world

showing results for - "difference between void and non void methods in java"
Eleonora
03 Apr 2017
1-void : does not return any value. 
2  The "void" return type means that
3  this method doesn't have a return type.
4	In an application, this approach
5    may be used to print runtime 
6    specific messages on the console. Exp: "setter" in encapsulation.
7	
8	-non-void: MUST return a Value.
9      (Data type needs to be same with return-type)
10	This means that you can use the 
11    returned value in your code for 
12      further processing. I guess good 
13      examples of such methods 
14      are "getter" in encapsulation.