Arya

Greenhorn
+ Follow
since Apr 14, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Arya

Hi All,
I have a stream of a file in the form of a Reader. I pass this Reader to a 'tool' that does something.
What I want to do is this:
After the stream has been obtained from a file I want to add something to the stream and still be able to pass the Reader to the 'tool' for processing.
Basically I want to add to the content of the file 'after' it has been and read(ie a Reader has been obtained) and I also want it to be in the form of a Reader so that it can be passed to the 'tool'.
Can anyone of you please suggest something on this ?
Thanks in advance.
Arya
19 years ago
As a rule of thumb one shouldnt have nested classes that go beyond 5 levels. Readability,clarity and usefullness of nested classes suffer incase nesting is continued beyond a certain point.
20 years ago
Hi Sandeep,
We make a method Static when the behaviour shown by the method does not depend on any particular instance of a class.
Singleton is a design option that you choose when you feel a single instance of class can serve the purpose.(laymans terms !)
Now, since any call to a method of a singleton class will be served by a single instance. So why take the trouble of creating a singleton class. Why not make the method static.
Well when we make a method static we must realize that we lose the advantages of inheritance(static methods are not inherited).With a Singleton class you can benefit from inheritance apart from other benefits that you get from this design pattern.
Hope I am clear :-)
20 years ago