j dam

Greenhorn
+ Follow
since Feb 01, 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 j dam

Rajeev Rnair wrote:

Prithvi Sehgal wrote:Dear Rajeev,

That's great to know. You will score 90+, that's my gut feeling. I am looking forward to hear your result.

I bought Enthuware today at-last after thinking so much. So pretty happy and yes this Software seems to have
a lot of questions. What do you suggest, should i start from Enthuware/ExamLab or Master Exams?

By the way your name and my dad name is identical 'Rajeev', so special Good luck to you.

Best Wishes,



thank you dear
i would recommend to start with Master exams, followed by Enthuware and Examlab

After Master exams, do couple of Enthuware, take a Examlab, do another couple of Enthuware, next Exam lab etc.
Exam Lab and Enthuware , use it as a learning tool.
After Master exams, you would be knowing the traps and pitfalls in the questions

best of luck again!



what do you mean by master exams? how can i find it?

W. Joe Smith wrote:Depends...what have you been scoring on the mocks? How were you scoring on the K&B Master exams? How did you do on the ExamLab mock?

If you are getting 80% or more on them you should be able to pass, I believe.



hi, I downloaded several exams, they are not online exams, so i don't know my score.

thanks for the tip, i will try some online exams and find out my score average.
hi guys, i am not confident enough to go into exam, i haven't booked an exam yet.

i am not sure if i am ready. this is what i have done:
read the book: SCJP by Kathy Sierra and Bert Bates
done several SCJP exams.

am i ready? can someone please tell me what i need to study before i go into exam? $300 is a lot.

David Newton wrote:The criteria says that observers must be notified for *all* methods that add/remove list items; I don't see how you've fulfilled that requirement.



nope it is not fullfilled, it is why i am not sure how to do this.
14 years ago

Raga Vendran wrote:Observer design pattern is what you need to look for handling such scenarios.

Thanks,
Ragavendran.



thanks for the help. this is what i got so far. I still have these questions:
1) Create a new class ObservableList that extends java.util.ArrayList and extend Observable
2) The notification must allow the listeners to access the items that were added/removed and the List they belong to.
3) All ListListeners that are registered with an ObservableList must be "notified" every time one or more items are added or removed from that list, no matter what method was called to modify the list. Be sure to check the API docs for ArrayList to make sure you cover all of the various add and remove methods.

can someone modify my code to answer the two questions that i am stucked on? thank you so much.
14 years ago

marc weber wrote:How far have you gotten, and where are you stuck?


this is what i got so far... I know how to code java, i got scjp. But i forgot everything that i learned about event and listener.
It would be a good idea to learn from this experience. but i am pretty much stuck at the start.

public interface ObservableList {
void register();
void unregister();

}

import java.util.*;
public class ListListener extends ArrayList{

}
14 years ago
hi guys,

i just got job interview. now the employer wanted me to write a java even listener. I admit my java skill is very weak. but i do want see how event and listener work. can someone help? thank you so much.

here is what they ask me to do:

· Create a new class ObservableList that extends java.util.ArrayList

· ObservableList must allow any class that implements a new interface (that you define) called ListListener to "register" and "unregister" with it.

· All ListListeners that are registered with an ObservableList must be "notified" every time one or more items are added or removed from that list, no matter what method was called to modify the list. Be sure to check the API docs for ArrayList to make sure you cover all of the various add and remove methods.

· The notification must allow the listeners to access the items that were added/removed and the List they belong to.

· It is up to you to decide how to best implement the notification mechanism, however for this exercise notifications only need to be sent to objects that live in the same JVM process. In other words, don't use JMS or anything distributed.

· There are no specific requirements on how this class should deal with multiple concurrent threads. Implement the best, most reasonable multi-threading features you can think of given the scope of this exercise. At a minimum, please document in your code comments all of the important multi-threaded issues you can think of.

· Create a class TestListListener that implements ListListener and prints every notification it receives from ObservableList. It should print at least what kind of change occurred and the item(s) that were added/removed.

· Include at least one unit test that uses ObservableList with TestListListener and demonstrates its features. (You're more than welcome to include more.) It should use at least two instances of ObservableList and at least three instances of TestListListener (you can use more). Use whatever combinations of lists and listeners and method calls you think best demonstrates the most functionality.
14 years ago

vinit sharma wrote:StringBuilder or StringBuffer (mutable)


now i think you got your answer???



hi, the second poster already answered your question.

Java has temporary memory to store short strings. here is example:

String a = "abc"; String b ="abc";
if (JVM temporary memory has "abc") then (a and b always refer to the same object)