1. A constructor method is special kind of method that determines how an object is initialized when created.
2. Constructor has the same name as class name.
3. Constructor does not have return type.
4. Constructor cannot be over ridden and can be over loaded.
5. Default constructor is automatically generated by compiler if class does not have once.
6. If explicit constructor is there in the class the default constructor is not generated.
7. If a sub class has a default constructor and super class has explicit constructor the code will not compile.
Subscribe to:
Post Comments (Atom)
private methods on Interface
Private methods can be used on interface from java 9. This will help in Avoiding code duplication. Ensuring code re-usab...
-
When an object is no longer referred to by any variable, java automatically reclaims memory used by that object. This is known as...
-
1. If a name has more the one word, then except the first word others should start with the uppercase. Examples : setLayout, addLayoutCompon...
-
Step 1: Create a shortcut for eclipse.exc Step 2: Right click eclipse short cut and add target value with “-vm "C:\Program Files\J...
No comments:
Post a Comment