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
14
OOP/Java/Lab/Week7/ExampleQues/Example1.java
Normal file
14
OOP/Java/Lab/Week7/ExampleQues/Example1.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
class Example1 {
|
||||
|
||||
//Static class
|
||||
static class X {
|
||||
|
||||
static String str = "Inside Class X";
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
X.str = "Inside Class Example1";
|
||||
System.out.println("String stored in str is- " + X.str);
|
||||
}
|
||||
}
|
||||
// Output: String stored in str is- Inside Class Example1
|
Loading…
Add table
Add a link
Reference in a new issue