mirror of
https://github.com/ASDjonok/OOP_IO-2x_2023.git
synced 2026-04-01 21:21:50 +03:00
21 lines
409 B
Java
21 lines
409 B
Java
package encapsulationInheritancePolymorphism;
|
|
|
|
public class Encapsulation {
|
|
/*private*/ int field;
|
|
private int field2;
|
|
// int a = 1;
|
|
|
|
public void myMethodForTheField () {
|
|
System.out.println(field);
|
|
}
|
|
|
|
public void myMethodForTheField2 () {
|
|
System.out.println(field);
|
|
}
|
|
|
|
public void myMethodForTheFieldAndTheField2 () {
|
|
System.out.println(field);
|
|
}
|
|
}
|
|
|