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 are memory considerations of jsp compares to other web components?
Are there books about seam?
What are the types of scaling?
Can we sent objects using Sockets?
What is Remote Server?
Explain what is orm?
What is the purpose of the wait(), notify(), and notifyall() methods?
What is abstract schema?
To what value is a variable of the string type automatically initialized?
What is aop(assepct oriented programing)?
What do you know about seam?
What is mdb and what is the special feature of that?
Why use a datasource when you can directly specify a connection details? (in a J2EE application)
How primary key is implemented in Oracle?
how i secure my site with the https protocol.what are the steps?