inheritance

interface Interviewer {

 void startInterview(); // or abstract startInterview();
 
 static void bookConferenceRoom(LocalDateTime dateTime, int duration) {
  System.out.println("Interview scheduled on:" + dateTime);
  System.out.println("Book conference room for: " + duration + " hrs");
 }

 default void condactInterview() {
  System.out.println("Accept");
 }
}

class Manager implements Interviewer {
 
 public void startInterview(){
  System.out.println("Inerview is started");
 }
 public static void main(String[] args) {
  
  Manager manager = new Manager();
  manager.condactInterview();
  
  Interviewer.bookConferenceRoom(LocalDateTime.now(), 2);
 }
}

No comments:

Post a Comment

bilymed.blogspot.com/