wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes what is the difference??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "what is the difference???" Watch "what is the difference???" New topic
Author

what is the difference???

malathi latha
Greenhorn

Joined: Feb 11, 2001
Posts: 21
Hi all
consider the following code snippets
/*****code snippet1******/

/***end of code snippet1****/

/***code snippet2****/

/***end of code snippet2**/
the first snippet works fine it doesn't complain about the absence of explicit default constructor declaration
but the second code complains!!
please can anyone explain me the difference..
thank you
malathi
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi,
Both fail for me with compile error: Missing default constructor!
Manfred.
Gaurav Mantro
Ranch Hand

Joined: Sep 08, 2000
Posts: 61
Hi Malathi.
Have you compiled the code ? Because according to my understanding both code snippet should fail as mentioned by Manfred.


------------------
http://www.mantrotech.com


----------------------<br />regards.<br /><a href="http://www.mantrotech.com/editors/gaurav_mantro.asp" target="_blank" rel="nofollow">Gaurav Mantro</a><br /><a href="http://www.mantrotech.com/technology/java/index.asp" target="_blank" rel="nofollow">Java Information Portal</a> - <a href="http://www.mantrotech.com/technology/java/index.asp" target="_blank" rel="nofollow">http://java.mantrotech.com</a>
anil kuchana
Ranch Hand

Joined: Sep 08, 2000
Posts: 404
Hi malathi,
I think u did a mistake in your question itself,
if in code snippet1 if you specify a return type such as void for method test[ in which case it wouldn't be a constructor anymore] then your thinking is right,
if you dont mean it then they both are same snippets.
Anil.
/***** http://www.anilbachi.8m.com scjp resources*****/////


http://www.skillfox.com Home of Java Skills SCJP 5.0, SCBCD, SCEA mock exams
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is the difference???
 
Similar Threads
Linked List equals method
what is the difference???
Why Bit shift with long doesn't promote
javabeat generics question doubt
StringBuffer and the equals() method