aspose file tools
The moose likes Java in General and the fly likes Query--Abt storing Methods Class Constructors.... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Query--Abt storing Methods Class Constructors...." Watch "Query--Abt storing Methods Class Constructors...." New topic
Author

Query--Abt storing Methods Class Constructors....

Venkatesh Ganesh
Greenhorn

Joined: Feb 12, 2006
Posts: 3
Hi...

I have learnt from a book that a constructor and a method(both in the same class)might have the same name.And the answer given by the author was:
They both occupy different 'namespaces'so no collision.

1.I want to know what is meant by 'namespaces'.?
2.In Memory where the class,variables,methods are stored?

Thanks
Venkatesh
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14672
    
  11

Instead of trying to understand what namespace means in this case,
I'd say to myself : "setting a method name with the same name as the constructor should be considered as bad practice"

The programmer who does this is living in another namespace too


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Query--Abt storing Methods Class Constructors....
 
Similar Threads
inheriting variables
Abt Memory
One class implement two interfaces with common methods??
local method inner class
Multiple Inheritance in java