From 4091242dd96dc43b0468c058bc070cdf46b19fa1 Mon Sep 17 00:00:00 2001 From: Aadit Agrawal Date: Sat, 14 Sep 2024 01:56:26 +0530 Subject: [PATCH] Upload files to "OOP/Java/Lab/Week7/ExampleQues" --- OOP/Java/Lab/Week7/ExampleQues/Example6.java | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 OOP/Java/Lab/Week7/ExampleQues/Example6.java 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.