Will it be called overriding if I do not change the
parameters or return type, instead throw a different
exception in the method signature.
Answer Posted / siva
public class MyOverriding {
int add(int a, int b)throws Exception{ //TRUE
return a+b;
}
}
class SubClass extends MyOverriding {
int add(int a, int b)throws NullPointerException{
return a+b;
}
}
//BELOW CODE IS GETTING COMPILER ERROR
public class MyOverriding {
int add(int a, int b)throws NullPointerException{
return a+b;
}
}
class SubClass extends MyOverriding {
int add(int a, int b)throws Exception{
return a+b;
}
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is message driven beam?
What is the highest-level event class of the event-delegation model?
we use MainFrame and using os390 for operating system with DB2 data base in IRAN and interest programing with java and use webspere for world wide,please help me where i should start?
What is RMI and what are the services in RMI?
what is Activation Instantinator?
What is a policy?
How messaging services are done, before release of JMS?
Can you control when passivation occurs?
What is the difference between the session.update() method and the session.lock() method?
What are the purpose of introspection?
What is scalable, portability in the view of J2EE?
What are callback interfaces?
Can I use javascript to submit a form?
Which are the different segments of memory?
How are commas used in the intialization and iteration parts of a for statement?