Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pro1;
- public class Prog2{
- public static void main(String[] args) {
- Emp e = new Emp();
- e.display();
- }
- }
- class Emp implements Employee{
- @Override
- public void display() {
- System.out.println("----------------------");
- System.out.println("|Dept. No |Dept. Name|");
- System.out.println("----------------------");
- System.out.println("|"+deptno+" |"+deptname+" |");
- System.out.println("----------------------");
- }
- }
- interface Employee{
- int deptno = 0;
- String deptname = "CSE";
- void display();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement