Upload files to "OOP/Java/Lab/Week7/ExampleQues"
This commit is contained in:
parent
6b9647add4
commit
4091242dd9
1 changed files with 23 additions and 0 deletions
23
OOP/Java/Lab/Week7/ExampleQues/Example6.java
Normal file
23
OOP/Java/Lab/Week7/ExampleQues/Example6.java
Normal 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.
|
Loading…
Add table
Reference in a new issue