0% found this document useful (0 votes)
7 views1 page

Cla

Uploaded by

Dhavan Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Cla

Uploaded by

Dhavan Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Array of Strings:

* used to store more strings in one String variable.


syntax:
String variable[]=new String[size];
ex:
String names[]=new String[5];
names[0]="Raju";
names[1]="Suri";
names[2]="John";
names[3]="Abbas";
names[4]="Murali";
for(String name:names) {
System.out.println(name);
}

Initialization:
String names[]={"Raju","Ramesh","Suresh","Manohar"};

System.out.println(names[0]);

Command Line Arguments(CLA):


* arguments which we passed to main() method in java
program.
* In eclipse , CLA are passed by configuring project
1.right click on Java file
2.select run as
3.click on run configurations
4. click on arguments tab
5. type program argumets
6. click apply
7.click close

ex
for(String name:args) {
System.out.println(name);
}

>java ClassName arg1 arg2 arg3 ...

You might also like