abstract class Transaction implements Runnable { }
class Deposit extends Transaction
{
protected void process()
{
addAmount();
}
void undo(int i)
{
System.out.println("Undo");
}
}
What will happen if we attempted to compile the code?
Select the one right answer.
1. This code will not compile because parameter i is not used in undo().
2. This code will not compile because there is no main() method.
3. This code will not compile because Deposit must be an abstract class.
4. This code will not compile because Deposit is not declared public.
5. Everything will compile fine.
Correct answer : 3
Why ?
pankaj