Shaik Muhammad

Ranch Hand
+ Follow
since Jul 16, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Shaik Muhammad

Thanks for the reply...
You mean to say that it is to reduce redundancy?
15 years ago
Thank you..
I tried getting os name from runtime instance. It cannot be retrieved by runtime instance. So i used

Why runtime instance is not giving os name?
15 years ago
Hi
I am trying to execute 'ping' command in my linux machine through a java program. I am using the following method to execute the command.


The problem is that the options for the ping command are different for windows and linux.
How can i find the type of the process that is started by the exec(command) method(ie. like UNIXProcess or Win32 process)?
What are the types of processes java uses?(ie. like windows process or linux process or mac process).
How can i get their type?
Please Help
15 years ago
Hi,

I often come across the following scenario. I have a method that returns a list of elements that satisfy a specific criterion. If there is no elements that match a specific criterion, which is the better value that the method can return? null or a empty list.

I personally feel that returning null causes the caller methods to check for null everytime the method is called. Also, returning empty means unnecessarily a collection is created which will never contain any element in it.

Please suggest a better return value.
15 years ago
Hi,
I am trying to forward a httpservletrequest to a servlet from a controller servlet. When i call the method with web.servlets.loginServlet as input parameter, this method throws IllegalArgumentException saying that the input parameter does not contain '/'. Please help.
16 years ago
Hi,
My application uses am implementor of HttpSessionListener to remove the HttpSession instance that is stored in a map when that session is invalidated. My problem is , after logging into the application, when i manually clear the cookies in my browser, this listener class is not called . How to get my application notified when cookies are cleared in the interim. Please help
16 years ago

What is Reentrancy? How does Reentrant lock differ from ordinary synchronized block. pl explain

What is Reentrancy? How does Reentrant lock differ from ordinary synchronized block. pl explain
Punit and Ankit, Thank you for the help
Thanks punit..

Ankit Garg wrote:Shaik there is no rule when to use an inner class. It is a matter of situation. Usually you use anonymous classes while doing Event Handling in GUI. Apart from that you might want to keep a related class inside another class. Take an example of Map.Entry in the Java API for that (although Map and Map.Entry are both interfaces but it can be taken as a good example). Since an Entry is related to a Map, so Entry was declared inside Map instead of making it a top level interface...


Ankit, Thanks. Also, can you clarify this. You mean to say that inner classes only help to increase readability of the code(in cases other than gui)?


Hi,
Can you anyone please tell me when should i go for inner classes? How does it help if i use an inner class replacing a separate class?
Hi,
Can you anyone please tell me when should i go for inner classes? How does it help if i use an inner class replacing a separate class?
16 years ago