what is default constructor and parameterised constructor
with example?
Answer / tushar
Default constructor: this constructor is created by the compiler automatically whenever an object is created.User don't have to write default constructor every class has its default constructor
Parameterized constructor: this constructor is exclusively written by the coder to assign the initial value to an instance variable.By creating parameterized constructor you can overwrite the default constructor.
| Is This Answer Correct ? | 1 Yes | 0 No |
What do you mean by flow of struts?
How to display arraylist values in java?
What is the exception hierarchy in java?
If I will write String s=new String("XYZ"); String s1=new String("XYZ"); if(s.equals(s1)){ sop("True"); } else{ sop("False"); } This program will give me "True". But When I am creating my own class suppose class Employee{ public Employee(String name); } Employee e= new Employee("XYZ"); Employee e1 = neew Employee("XYZ"); if(e.equals(e1)){ sop("True"); } else{ sop("False"); } Then it will give the output as "False". Can I know what is happening internally?
What is singleton class and how can we make a class singleton?
What is anagram word?
what us Dyna action form?
4 Answers Aithent Technologies,
What are packages and name a few?
What is string and its types?
What do you mean Abstraction in java?
What is purpose of find feature?
Why we do exception handling in java and how many types of exceptions are there?