-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatic.java
More file actions
32 lines (27 loc) · 755 Bytes
/
Copy pathStatic.java
File metadata and controls
32 lines (27 loc) · 755 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
// class HondaCity{
// static int x=20;
// int y=10;
// void show(){System.out.println(y+" "+x);}
// static void display(){System.out.println(x);}
// }
// public class Static {
// public static void main(String[] args) {
// HondaCity h=new HondaCity();
// h.x=100;
// h.y=200;
// h.show();
// HondaCity h1=new HondaCity();
// h1.display();
// h1.show();
// }
// }
// DEMO //
class test{
static {System.out.println("block 1");}
static {System.out.println("block 2");} }
public class Static{
public static void main(String[] args) {
System.out.println("main");
test t=new test();
}
}