Upload files to "OOP/Java/Lab/Week7/ExampleQues"

This commit is contained in:
Aadit Agrawal 2024-09-14 01:56:26 +05:30
parent 6b9647add4
commit 4091242dd9

View File

@ -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.