Can we override constructor in java?



Can we override constructor in java?..

Answer / Kamal Swaroop

No, constructors cannot be overridden in Java. However, a subclass can provide its own constructor that invokes the superclass's constructor using the super keyword.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the longest unicode character?

1 Answers  


How can we break singleton in java?

1 Answers  


public class Garbage { int a=0; public void add() { int c=10+20; System.out.println(c); System.out.println(a); } public static void main(String args[]) { Garbage obj=new Garbage(); System.gc(); System.out.println("Garbage Collected"); obj.add(); } } Above is a code in java used for garbage collection. object obj has been created for the class Garbage and system.gc method is called. Then using that object add method is called.System.gc method if called the obj should be garbage collected?

6 Answers  


Difference between overloading and Overriding. <Giving a confusing example to test the concept.> (also asked in PA Consultancy Group,iflex,Value chain,IBM,CTS,Accenture, Tarang>

12 Answers   Accenture, CTS, Extensio, IBM, iFlex, PA Consulting, Symphony, Tarang,


What modifiers may be used with a top-level class?

1 Answers  


Can you declare the main method as final?

1 Answers  


Is an object null?

1 Answers  


Differentiate between postfix and prefix operators in java.

1 Answers   HCL,


What do you mean by exception handling in Java?

1 Answers   Atos Origin,


What is polymorphism in java? What are the kinds of polymorphism?

1 Answers  


can you create interface instance ?

54 Answers   Fidelity, TCS,


What is the inheritance?

1 Answers  


Categories