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
17
OOP/Java/Lab/Week7/ExampleQues/Example2.java
Normal file
17
OOP/Java/Lab/Week7/ExampleQues/Example2.java
Normal file
|
@ -0,0 +1,17 @@
|
|||
class Example2{
|
||||
int num;
|
||||
|
||||
//Static class
|
||||
|
||||
static class X{
|
||||
static String str="Inside Class X";
|
||||
num=99;
|
||||
// static int num = 99;
|
||||
// would be the correct syntax
|
||||
}
|
||||
|
||||
public static void main(String args[]){
|
||||
Example2.X obj = new Example2.X();
|
||||
System.out.println("Value of num="+obj.str);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue