public class Base {
public void myMethod(int a,intb) {}
}
// Uses myMethod and then hides it.
public class DerivedOne extends Base {
private void myMethod(int a,int b);
}
will this compile or not .yes or no. why
Answers were Sorted based on User's Feedback
Answer / ashwin khandelwal
It cannot be compiled because of weaker access privilege give to method in DerivedOne class while overidding method of Base Class
| Is This Answer Correct ? | 12 Yes | 0 No |
Answer / narayana
This will not compile because in the base class myMethod()
function is not having the body ,only abstract methods
should not have the body remaining all methods should have
the body
| Is This Answer Correct ? | 6 Yes | 6 No |
What is the meaning of find and replace?
What is the definition of tree ?
How to change value in arraylist java?
define polymorphism in java
what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread
What are the two ways in which thread can be created?
How many types of java are there?
What is boolean data type in java?
Hi ,i convert contrller as jSp And presentation as servlet ...will it do? if so what are advantage and idsadvantages
What are the 6 mandatory procedures for iso 9001?
What is the difference between break and continue statements?
Can the interface be final?