Upload files to "OOP/Java/Lab/Week7/ExampleQues"
This commit is contained in:
parent
3c665489ed
commit
6b9647add4
5 changed files with 94 additions and 0 deletions
15
OOP/Java/Lab/Week7/ExampleQues/Example5.java
Normal file
15
OOP/Java/Lab/Week7/ExampleQues/Example5.java
Normal file
|
@ -0,0 +1,15 @@
|
|||
class Example5 {
|
||||
|
||||
static int i;
|
||||
static String s;
|
||||
|
||||
public static void main(String args[]) { //Its a Static Method
|
||||
Example5 obj = new Example5();
|
||||
//Non Static variables accessed using object obj
|
||||
System.out.println("i:" + obj.i);
|
||||
System.out.println("s:" + obj.s);
|
||||
}
|
||||
}
|
||||
//Output:
|
||||
//i:0
|
||||
//s:null
|
Loading…
Add table
Add a link
Reference in a new issue