Sriram Naga

Greenhorn
+ Follow
since Aug 24, 2010
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 Sriram Naga

Any practical examples of where it can be used effectively in real world scenarios?
13 years ago
The thread gets executed anyway. But you can't refer to that thread object once you assign it to null. You will get a Null Pointer exception if you do so.
13 years ago
@Srinivas,

What Fred and Venkat has suggested might have suggested is correct and the right way. I assume if you were looking just for the code, you wouldn't have posted it here but googled it.

So let's see the approach.

Normally on paper, we would

1. Write each word, line by line.
2. If there is a repetition, increment the count next to the word.
3. At the end we would have the list of all words, with the respective number of occurrences to their right.

one two three two one one

one - 3
two - 2
three - 1

Think of a data structure which can solve this. Refer to Java Collections.

Also before insertion, you got to "break" the string, to have individual words.

Try it and if you don't get the answer, would be happy to help you soon.

Others, please correct me if I am wrong.


13 years ago
Are you referring to the use of hprof?

Please have a look at this Sun article.

http://java.sun.com/developer/technicalArticles/Programming/HPROF.html
13 years ago
@Aamir

Also note that you can't instantiate an abstract class. The subclass which extends the abstract class needs to implement the unimplemented methods(declared as abstract in this case).
13 years ago
An Interface IS-A Object can be misleading as many said above.

An Interface has no state and can't be instantiated.

Maybe the ExamLab question was referring to.. "An Interface reference IS-A Object", which surely is, since it refers to the instance of the class which implements the interface in question.

13 years ago
Did you increase the stack size?
Segmentation fault in this case might be due to lack of memory.
I think you have already increased the initial heap size.
13 years ago
We need to explicitly null the references to an object if it is in invisible state(when the strong references no longer accessible in the program though existing). How do we identify such scenarios?
13 years ago