wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Question re: Identifiers 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 "Question re: Identifiers" Watch "Question re: Identifiers" New topic
Author

Question re: Identifiers

Mike Kelly
Ranch Hand

Joined: Jul 18, 2001
Posts: 78
Can a normal method be named the same as the class, and if so how can we tell it from a constructor?
frank davis
Ranch Hand

Joined: Feb 12, 2001
Posts: 1479
A method must have a return type, a constructor does not.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4446
    
    5

Yes, if you really want to confuse users of the class
A normal method must have a return type (even if it is just void) while constructors can not have a return type.


[This message has been edited by JUNILU LACAR (edited July 23, 2001).]


Junilu - [How to Ask Questions] [How to Answer Questions]
Mike Kelly
Ranch Hand

Joined: Jul 18, 2001
Posts: 78
Originally posted by herb slocomb:
A method must have a return type, a constructor does not.

Thanks, got it.
Desai Sandeep
Ranch Hand

Joined: Apr 02, 2001
Posts: 1157
Mike, just donot think about it


<b>Sandeep</b> <br /> <br /><b>Sun Certified Programmer for Java 2 Platform</b><br /> <br /><b>Oracle Certified Solution Developer - JDeveloper</b><br /><b>-- Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java </b><br /><b>-- Object-Oriented Analysis and Design with UML</b><br /> <br /><b>Oracle Certified Enterprise Developer - Oracle Internet Platform</b><br /><b>-- Enterprise Connectivity with J2EE </b><br /><b>-- Enterprise Development on the Oracle Internet Platform </b>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question re: Identifiers
 
Similar Threads
Can the color for the disabled item be changed
WA #1.....word association
Private methods
URGENT - NEED HELP - Block Code
error in Marcus Green 2.