Array making
public class Main {
public static void main(String[]ar){
// array diclair karna
String[] array1 = new String[10];
// array main value dalna
array1[0] = "rafiq";
array1[1] = "hayat";
array1[2] = "raja";
array1[3] = "gohar";
array1[4] = "naeem";
array1[5] = "qadeer";
array1[6] = "rahim";
array1[7] = "ibraheem";
array1[8] = "thanver";
array1[9] = "tosif";
//assay say value nikalna 2 posstion
par raja hay to rafa print hogaSystem.out.println(array1[2]);
//dosta tariqa array main value dalny ka
String[] aryVadiableName = {"rafiq", "hayar" , "raja"};
//0 posstion par rafiq hy to rafiq print hoga
System.out.println(aryVadiableName[0]);
}
}
Comments
Post a Comment