Barkat Mardhani

Ranch Hand
+ Follow
since Aug 05, 2002
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 Barkat Mardhani

Hello,

I am unable to find any resource that describes how JFormattedTextField will behave if user inputs a negative number. I am using following code:


Thanks for your help.
Barkat
18 years ago
How is this tittle?

The Definitive Guide To Java Swing (Definitive Guide)
by John Zukowski

Thanks
Barkat
18 years ago
Hello,

Can anyone please recommend a good book for learning swing quickly?

Thanks
Barkat
18 years ago
Free floating bocks can be non-static as well.
I have no knowledge about this More Servlets and JSP book.
The book I was talking about is
web page
You are ahead of me in other stuff.
I am still double minded about Web Component exam or WebShphere exam by IBM. Which one to go for?
Thanks
Barkat
[ November 10, 2003: Message edited by: Barkat Mardhani ]
[ November 10, 2003: Message edited by: Barkat Mardhani ]
Great job Vinod.
Hey Paul,
I just passed programmers certification. And I have already started studying for Web component exam. But after reading about this one 'websphere by IBM' cerfication, I am feel like changing my mind. Is there a good comparision between the two? Am I correct in judgement that webshpere certification will land me job sooner?
Thanks
Barkat
20 years ago
Hi Vad,
Good to see you in this site as well. I am looking for same answers as well. So far everyone seems to like this study guide from Manning. I am ording it now. I have also purchased "Java for the Web with Servlets, JSP and EJB" by Budi Kuriawan. It seems very good book. I read 3 chapters so far. It appears that it covers all needed topic for the exam. I am planning to read it cover to cover before reading the Manning study guide.
Best of luck.
Barkat
Thanks Marlene. And thanks all. This learning experience was very fullfilling with all of us wanting to help each other.
20 years ago
Great Score. Congratulations.
20 years ago
Great score Vad.
20 years ago
Thanks Corey. I got to point where you got when you said:

This will give you a compiler error because the get(int, int) method says it returns a BitSet object rather than a Test object. We, of course, know better. We can add an explicit cast to make the code compile:

code:
--------------------------------------------------------------------------------
Test t = new Test();Test t1 = (Test)t.get(0,0);
--------------------------------------------------------------------------------
I don't really know if that answered your question or not, but it's a start. If you're still confused, try to explain what you're after a little more and I'll try to help.


That will compile fine. But it will fall apart at runtime.
Here is what I want to do:
1. I am creating a wrapper on BitSet class to add more functionality.
2. But I want to continue to use all available method in BitSet class on the object of BitSetWrapper class, including the get() method without rewriting it.
3. However, get() returns a BitSet object. If I use this get() method as it is in the super class on BitSetWrapper objects, it will return a BitSet object. However, I wanted it return BitSetWrapper object as it was applied on a BitSetWrapper object.
4. I guess I am out of luck. I have to override get().
Thanks
Barkat
This is a sample question from TheServerSide.com:


Choose the correct one:
a.) MyServlet is thread safe.
b.) MyServlet is not thread safe because myName is an instance variable.
c.) MyServlet is not thread safe because MyServlet implements SingleThreadModel.
d.) None of the above.
Correct choice
A
Explanation
Choice A is correct. An application is thread safe if it always behaves predictably regardless of the number of concurrent threads running in its process space. The simplest way to ensure that a servlet is thread safe is to implement the SingleThreadModel interface. By implementing this interface, the server guarantees that no more than one thread can execute the service(), doGet(), or doPost() method at a time for a particular servlet instance. This makes the servlet thread safe. Thus even if class MyServlet has instance variables, it is thread safe. Thus A is the correct choice and the other choices are incorrect.


What if container initiates a second instance of same servlet... No two threads can simultanously access a single instance but two threads can access two separate instances. As each instance will want to work on same attribute, this might render itself thread unsafe...
Any comments.
Barkat
I am extending the API class BitSet. There is a get() method in BitSet class that returns a BitSet object. I am calling that method on a sub class type object and expecting a sub class type object returned. But I am getting back super class type object:

Is there anyway I can have it return sub class type object?
Thanks
As more than one thread can attempt to modify context attribut, would not be a good idea to synchronze the modification code on the contect attribute?
sysnchronized (aContextAttribute) { }
Why can'nt JVM work on server as well and two JVMs (at client and at Server) communicate with each other via HTTP protocals?