Advertisement
shawonrog

Interface

Mar 19th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1.  
  2. package javalab;
  3.  
  4. interface man{
  5. void name();
  6. }
  7. interface woman{
  8. void occupation();
  9. }
  10.  
  11. class human implements man,woman{
  12.  
  13. public void name(){
  14. System.out.println("Atik");
  15. }
  16. public void occupation(){
  17. System.out.println("Teacher");
  18. }
  19. }
  20.  
  21. public class interfaceP{
  22. public static void main(String[] args) {
  23. human h1=new human();
  24. h1.name();
  25. h1.occupation();
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement