Posts

Showing posts with the label parameters

Parameters,Arguments & Constructor

Image
 Parameters and Arguments Today we're here to discuss about parameters and arguments in JAVA. Let's look at it by studying the above example. Parameter is there to keep inputs and outputs. Information can be passed to a method by using parameter list. Parameters act as variables inside a method. We can add many Parameters by seperating with commas. When a   parameter is passed to a method,it is called an argument. Arguments in JAVA are actually the values that are passed to the variables in a method. Return type is used to return the output. In JAVA, the default return type is "void".It can return any data type or String value. And also String or any data type can be used as the return type.But we must use the "return" keyword inside the method. eg:- 1) int area (int x,int y){         int z=x*y;         return z;         System.out.print(z);         }         area (7,13); ...