II B.Tech II Sem CSE Java Lab Exercise – 8 (Runtime Polymorphism)

a)Runtime Polymorphism

Aim: To write a JAVA program that implements Runtime polymorphism


Description:



Program:

class A 
{
void display() 
{
System.out.println("Inside A class"); 
}
}
class B extends A 
{
void display() 
{
System.out.println("Inside B class"); 
}
}
class C extends A 
{
void display() 
{
System.out.println("Inside C class"); 
}
}
class runtimedemo 
{
public static void main(String args[]) 
{
A a1=new A(); 
B b1=new B(); 
C c1=new C(); 
A ref;
ref=c1; 
ref.display(); 
ref=b1; 
ref.display(); 
ref=a1; 
ref.display();
}
}

Output:

1 comment

File Uploading in PHP

  File Uploading in PHP PHP allow you to upload any type of a file i.e. image, binary or text files.etc..,PHP has one in built global variab...