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

This commit is contained in:
Aadit Agrawal 2024-09-14 01:56:07 +05:30
parent 3c665489ed
commit 6b9647add4
5 changed files with 94 additions and 0 deletions

View 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);
}
}