when asub class inherits a super class and overrides a
public method of super class in sub class(public method in
super class).
why these methods needs to be public in sub class.
(otherwise compile time error).
Answer Posted / sushila
if super class method is public, then override method should
be public.
override method will take same access specifier or expanded one.
the order of access specifier is
private > default > protected > public
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
In the below example, how many string objects are created?
Can we have static methods in an interface?
What all methods are used to prevent thread execution ?
How many types of memory areas are allocated by jvm?
What is compareto?
Can we override constructors?
State one difference between a template class and class template.
How do you reverse sort a list in java?
What is nested interface?
What does java ide mean?
What is the difference between preemptive scheduling and time slicing in java programming?
Explain about the security aspect of java?
Write a java program to count the number of words present in a string?
What is the difference between the prefix and postfix forms of the ++ operator?
Does java allow default arguments?