Skip to content

Commit 081fdee

Browse files
static vs non-static
1 parent be0dffb commit 081fdee

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

serve static and non-static

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
public class oop1 {
2+
3+
static void raman()
4+
{
5+
System.out.println("hello world");
6+
}
7+
8+
public void ajit()
9+
{
10+
System.out.println("my name is khan");
11+
}
12+
13+
public static void main(String[] args)
14+
{
15+
16+
//to serve static we dont require object
17+
raman();
18+
// to serve non-static file we require object
19+
oop1 obj12=new oop1();
20+
obj12.ajit();
21+
22+
}
23+
}

0 commit comments

Comments
 (0)