In this tutorials we will discussed more about variables in java programming of Parameters Or Arguments Variables.
Types of variables:
Class Or StaticInstance
Local
Parameters Or Arguments
What we need before start the code, I'm using as mention below and already installed in my system:
1. JDK1.6 or +
2. Eclipse
3. Windows OS
4. Basic knowledge of java
Let's start:
Verify the JDK installation
Open the command prompt and verify the java installation
Type the
C:\>javac -version
javac 1.7.0_25
C:\>java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b17)
Java HotSpot(TM) Client VM (build 23.25-b01, mixed mode, sharing)
Now java installation got verified, as installed JDK1.7.0_25
Verify the Eclipse installation
Go the the installation directory of eclipse and click on the eclipse.exe
Create the new java project in Eclipse
Open the eclipse
File
New
Java project
Type the project name: Variables_In_Java_Programming
Next
Finish
Create the ParametersOrArgumentsVariablesInJava.java file
Right click on the src created under project Variables_In_Java_Programming
New
Class
Type the name of class: ParametersOrArgumentsVariablesInJava
Type the package name: com.variables.atozexamples
Finish
package
com.variables.atozexamples;
public class
ParametersOrArgumentsVariablesInJava {
public
ParametersOrArgumentsVariablesInJava() {
// TODO Auto-generated
constructor stub
}
public void print(Object oParameterOrVariableAlsoKnownAsVariable) {
// Storing the
value of parameter or argument in local variable
Object
oLocalVariable = oParameterOrVariableAlsoKnownAsVariable;
// Printing the
local variable
System.out.println(oLocalVariable);
}
public static void main(String[] args) {
// New object
creation of ClassOrStaticVariablesInJava
ParametersOrArgumentsVariablesInJava
obj =
new
ParametersOrArgumentsVariablesInJava();
obj.print("This is the
example of Argument and Parameter");
}
}
All about Parameters Or Arguments variables in java programming.
No comments:
Post a Comment