-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccess.java
More file actions
38 lines (29 loc) · 736 Bytes
/
Copy pathaccess.java
File metadata and controls
38 lines (29 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import acessmod.*;
class B
{
private int d;
public int e;
protected int f;
public void showB()
{
System.out.println(d);
System.out.println(e);
System.out.println(f);
}
}
public class access
{
public static void main(String[] args)
{
B b1 = new B();
b1.showB();
//System.out.println(b1.d); --private only in same class
System.out.println(b1.e);
System.out.println(b1.f);
accessmodif a3 = new accessmodif();
System.out.println(a3.a);
// System.out.println(a3.b); --private not in diff package
// System.out.println(a3.c); --protected not in diff package
a3.checkA();
}
}