how you will prevent method overriding?

Answer Posted / sumit

One can prevent method overriding by marking the method final. if you make a method static and reuse it in the subclass it will hide the the super class method. This is called method hiding rather than overriding.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What invokes a thread's run() method in java programming?

575


Which software is used for java programming?

565


What is the purpose of checked and unchecked exceptions in JAVA?

571


What is the function of static in java?

547


Tell some latest versions in JAVA related areas?

565






What is replacefirst in java?

583


Is java free for businesses?

594


What is generic class?

652


Can inner class have constructor?

560


How do you check if a string contains only numeric digits?

626


How can a gui component handle its own events?

603


What does those terms actually mean included in the j.d.k i.6?

1610


What does the exclamation mark mean in java?

604


public class Test { public static void main(String[] args) { int countA = 0; int countB = 0; int countC = 0; int countD = 0; int countE = 0; int countF = 0; int countG = 0; int countH = 0; int countI = 0; int countJ = 0; int countK = 0; int countL = 0; int countM = 0; int countN = 0; int countO = 0; int countP = 0; int countQ = 0; int countR = 0; int countS = 0; int countT = 0; int countU = 0; int countV = 0; int countW = 0; int countX = 0; int countY = 0; int countZ = 0; } } Can anybody tell me any alternate solution(like loop or something) to automate this initialization process. Ex:- for(char chr='A';chr<='Z'; chr++) { (int) String "count"+chr = 0; }

1854


What is t in parametric equations?

559