lab30

PHOTO EMBED

Mon Oct 30 2023 09:39:05 GMT+0000 (Coordinated Universal Time)

Saved by @viinod07

import java.io.*;
class A
{
void display()throws InterruptedException
{
System.out.println("black");
}
}
class B extends A
{
void display()throws InterruptedException
{
Thread.sleep(1000);
System.out.println("white");
}
public static void main(String[] args)
{
A a=new B();
try
{
a.display();
}
catch(InterruptedException e)
{}
}
}



content_copyCOPY