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
Explain RMI Architecture?
What do you mean by Socket Programming?
What is the map interface?
Why does the tag url-encode javascript and mailto links?
What is the relationship between local interfaces and container-managed relationships?
What are the difference between RMI and CORBA?
what are the advantages of JTA over JTS?
What is metaspace?
Which containers use a border layout as their default layout?
Can I have an action without a form?
Should synchronization primitives be used on bean methods?
Define aop(assepct oriented programing)?
Explain how will the struts know which action class to call when you submit a form?
A user of a web application sees a jsessionid argument in the URL whenever a resource is accessed. What does this mean? a. The form must have the field jsessionid b. URL rewriting is used as the session method c. Cookies are used for managing sessions
What is the difference between the session.update() method and the session.lock() method?