ya...but why?
Because it is not necessary. If the base class is throwing exception, then derived class may or may not throw. And I am calling derived class's method on object.
Type: Posts; User: Arati2512
ya...but why?
Because it is not necessary. If the base class is throwing exception, then derived class may or may not throw. And I am calling derived class's method on object.
Oops....My mistake! It should be like this ---->
class A
void disp() throws Exception
{
throw new Exception();
}
Here is my code snippet ----->
class A
{
void disp() throws ArithmeticException
{
throw new ArithmeticException();
}
}
import java.io.*;
class A
{
public void display()
{
System.out.println("SuperClass");
}
}
public class B extends A
{
I am learning java swing programming and have a problem.
I want to create simple Bouncing ball application using threading and swing..
So, I created a JFrame and placed 2 buttons, start and stop,...