Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.io.*;
- class Person{
- protected String name;
- protected String email;
- protected int age;
- public Person() {}
- public Person(String name, String email, int age) {
- this.name = name;
- this.email = email;
- this.age = age;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getEmail() {
- return email;
- }
- public void setEmail(String email) {
- this.email = email;
- }
- public int getAge() {
- return age;
- }
- public void setAge(int age) {
- this.age = age;
- }
- public void identify() {
- System.out.println("Name: "+name+" Email: "+email+" Age: "+age);
- }
- public interface Worker{
- default public void getSalary(Integer n) {
- System.out.println("Your salary is: "+n);
- }
- }
- public interface Academicinterest{
- default public void getInterest(String s) {
- if (s == "Java" || s =="Management" || s =="Finance" ) {
- System.out.println(s);
- }
- }
- }
- }
- class Student extends Person{
- Person p;
- protected int avgrade;
- public Student(String name, String email, Integer age, )
- }
- public class main {
- public static void main(String[] args) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement