+ 2
Hello guys i am little much confused about return type in java.
In my view that return type is a value which we can pass with method is this right or wrong please answer me.
2 Answers
+ 13
The return type is the type of value which is returned from the function to the source of the function call.
int test() { return 3; }
public static void main(String[] args) {
System.out.print(test());
// prints 3
}
+ 4
The return type is the type of data that the method returns. The arguments are what you can pass in to the method. The return type and arguments can be different data types