-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
access specifier demo: package1 parent class
- Loading branch information
1 parent
310cccf
commit cdd197b
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package Lecture16.package1; | ||
|
||
public class Parent { | ||
|
||
public int d1 = 10; // public access specifier | ||
protected int d2 = 20; // protected access specifier | ||
int d3 = 30; // default access specifier | ||
private int d4 = 40; // private access specifier | ||
|
||
public void fun() { | ||
System.out.println("inside package1 fun"); | ||
} | ||
} |