PROGRAM TO IMPLEMENT RUNNABLE INTERFACE

//PROGRAM TO IMPLEMENT RUNNABLE INTERFACE class X implements Runnable { public void run( ) { for(int i=1;i<=10;i++) { System.out.println(“\t thread X: “+i); } System.out.println(“End of thread X”); } } class …

CREATING A THREAD USING A THREAD CLASS

//CREATING A THREAD USING A THREAD CLASS class A extends Thread { public void run( ) { for(int i=1;i<=5;i++) { System.out.println(“\t From thread A:”+i); } System.out.println(“Exit from A”); } } …

PROGRAM TO IMPLMENT SINGLE INHERITANCE

//PROGRAM TO IMPLMENT SINGLE INHERITANCE class Room { int length,breadth; Room(int x,int y)                //PARMETERIZED CONSTRUCTOR { length=x; breadth=y; } int area( ) { return(length*breadth); } } class diningRoom extends Room …

PROGRAM TO IMPLEMENT FUNCTION OVERLOADING

//PROGRAM TO IMPLEMENT FUNCTION OVERLOADING class Rectangle { int length,breadth; Rectangle( ) { length=10; breadth=5; } Rectangle(int l,int b) { length=l; breadth=b; } int area( ) { return(length*breadth); } public …