Advertisement
Guest User

jay

a guest
Sep 1st, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. package pro1;
  2.  
  3. public class Prog2{
  4.  
  5.     public static void main(String[] args) {
  6.         Emp e = new Emp();
  7.         e.display();
  8.     }
  9. }
  10.  
  11. class Emp implements Employee{
  12.  
  13.     @Override
  14.     public void display() {
  15.         System.out.println("----------------------");
  16.         System.out.println("|Dept. No |Dept. Name|");
  17.         System.out.println("----------------------");
  18.         System.out.println("|"+deptno+"        |"+deptname+"       |");
  19.         System.out.println("----------------------");
  20.     }
  21.    
  22. }
  23.  
  24. interface Employee{
  25.     int deptno = 0;
  26.     String deptname = "CSE";
  27.     void display();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement