Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions DAY8/Static.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

public class Hi{
static int a;
int b;
public static void main(String args[])
{
Hi h=new Hi();
Hi h2=new Hi();
h.a=10;
System.out.println("The value storing in h object of a:"+h.a);
h2.a=20;
System.out.println("The value storing in h2 object of a:"+h.a);
System.out.println("The value now in h object of a as it is static:"+h.a);


h.b=56;
System.out.println("The value storing in h object of b:"+h.b);
h2.b=90;
System.out.println("The value storing in h2 object of b:"+h2.b);
System.out.println("The value now in h object of b:"+h.b);

}

}