protect java
class Person {
protected String fname = "John";
protected String lname = "Doe";
protected String email = "[email protected]";
protected int age = 24;
}
class Student extends Person {
private int graduationYear = 2018;
public static void main(String[] args) {
Student myObj = new Student();
System.out.println("Name: " + myObj.fname + " " + myObj.lname);
System.out.println("Email: " + myObj.email);
System.out.println("Age: " + myObj.age);
System.out.println("Graduation Year: " + myObj.graduationYear);
}
}
Also in Java:
- indexof java
- delete element from arraylist
- dataframe to dict without index
- java scanner
- one line if statement java
- create notification android
- padding a string with 0 in java
- java how to make a gui
- how to create a thread local variable in java
- action on long press of edit edittext
- déclarer un tableau en java
- how to play an audio in java
- hello world java
- islowercase java
- how to have a only number type in java
- android how to know when snackbar is done
- spigot get player from UUID
- how to check if the file has remaining without reading from it java
- write file from a specific location in java
- 2 decimal places print format JAVA
- java insert into arraylist
- java swing change label icon
- @fortawesome/free-solid-svg-icons
- loop while in java