What is a constructor?
Answers were Sorted based on User's Feedback
Answer / suma
A constructor is one which is used to initialize the
instance variables of an object.
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / srinivasa reddy
Guarrented intilization of instance variables of an object.
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / saravanan
Class name and Methods name are same. It has no Return type.
When create a instance with class the method is
automatically called.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sunil kumar
Constructor is a special method having the same name as class name, without any return type not even void. And it is used to initialize the instance variable.
| Is This Answer Correct ? | 0 Yes | 0 No |
How to call the m1() method of Base class in below snippet ? class Base { public void m1() { System.out.println("Base m1 "); } public void m2() { System.out.println("Base m1 "); } } ====================== class Derived extends Base { public void m1() { System.out.println("Derived m1"); } public void m3() { System.out.println("Derived m3"); } public static void main(String[] args) { Base ob=new Derived(); ob.m1(); //System.out.println("Hello World!"+ob.m1()); } }
Hi Friends, i have searched in google but not clear. can you give bank example with synchronized keyword
What is markup language?
what is diff string and stringbuffer
what is class/object diagram
What are the different types of features of the java collections framework? : java collections
I have include a jsp page by using <jsp:include page="/.../xyz.jsp"/> The thing is that the xyz.jsp page has its submit button.When i click on that button the whole main page get refreshed.But i want to refresh only the xyz.jsp page.How could i achive it so that i can only refresh the xyz.jsp not the main page page?
what debugging tool that can be used to debug the java programs?
How to use ANT?
what is mean by hasing and maping in java platform and advantage?
Difference b/w >> and >>> ?
whats the relation ship between LDAP and JNDI?