diff --git a/OOP/Java/Lab/Week7/ExampleQues/Example6.java b/OOP/Java/Lab/Week7/ExampleQues/Example6.java new file mode 100644 index 0000000..03e0ed0 --- /dev/null +++ b/OOP/Java/Lab/Week7/ExampleQues/Example6.java @@ -0,0 +1,23 @@ +class Example6 { + + static int i; + static String s; + + //Static method + static void display() { + //Its a Static method + Example6 obj1 = new Example6(); + System.out.println("i:" + obj1.i); + System.out.println("i:" + obj1.i); + } + + void funcn() { + //Static method called in non-static method + display(); + } + + public static void main(String args[]) { //Its a Static Method + //Static method called in another static + } +} +// Last 2 } werenot included, but I added them.