-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
29 lines (20 loc) · 720 Bytes
/
Main.java
File metadata and controls
29 lines (20 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.yashas;
public class Main {
public static void main(String[] args) {
// q store 5 roll no
// int a=2;
// int b=4;
//int h=5;
// syntax
// datatype[] variable_name = new datatype[size];
// store 5 roll no
// int[] roll_no=new int[5];
// or
// int[] ro_no={2,3,4,5,6};
/* int[] roll_no;//-->[lhs part] declaration of array .roll_no is getting defined in the stack
roll_no=new int[5];// initialisation:actually here object is being created int the memory(hea)
System.out.println(roll_no[1]);
String[] arr= new String[3];
System.out.println(arr[1]);*/
}
}