File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the difference???

 
malathi latha
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1492
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Both fail for me with compile error: Missing default constructor!
Manfred.
 
Gaurav Mantro
Ranch Hand
Posts: 61
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
anil kuchana
Ranch Hand
Posts: 404
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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*****/////
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic