-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatic.java
More file actions
34 lines (33 loc) · 858 Bytes
/
Static.java
File metadata and controls
34 lines (33 loc) · 858 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
30
31
32
33
34
class Static{
static int num=10;
static String mystr="hello";
/*static{
System.out.println("Static Block 2");
num = 98;
mystr = "Block2";
}
static{package com.java2novice.wrapper.integer;
public class MyBasicInteger {
public static void main(String a[]){
int i = 10;
Integer intg = new Integer(i);
System.out.println(intg);
String no = "223";
Integer num = new Integer(no);
System.out.println(num);
}
}
System.out.println("hello");
num = 97;
mystr = "Static keyword in Java";
}*/
public static void main(String args[])
{
int num=15;
Static a=new Static();
System.out.println("Value of num="+a.num);
System.out.println("Value of mystr="+mystr);
}
}