Java Tutorials
How to Download & Install Java in Linux(Ubuntu)
Following is a step by step guide to install Java on Linux. In this training, we will install Java on...
Command Line Argument in Java is the information that is passed to the program when it is executed. The information passed is stored in the string array passed to the main() method and it is stored as a string. It is the information that directly follows the program’s name on the command line when it is running.
Example While running a class Demo, you can specify command line arguments as
java Demo arg1 arg2 arg3 …
Example: To Learn java Command Line Arguments
Step 1) Copy the following code into an editor.
class Demo{
public static void main(String b[]){
System.out.println("Argument one = "+b[0]);
System.out.println("Argument two = "+b[1]);
}
} Step 2) Save & Compile the code
Step 3) Run the code as java Demo apple orange. Step 4) You must get an output as below.
Following is a step by step guide to install Java on Linux. In this training, we will install Java on...
What is a Variable in Java? Variable in Java is a data container that stores the data values...
What Is An Array Of Objects? JAVA ARRAY OF OBJECT , as defined by its name, stores an array of...
What are Strings? A string in literal terms is a series of characters. Hey, did you say...
What is OOPS Concept in JavaScript? Many times, variables or arrays are not sufficient to simulate...
What is ArrayList in Java? ArrayList in Java is a data structure that can be stretched to...