May Pat

Ranch Hand
+ Follow
since Jul 01, 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 May Pat

Hi. I develop a web service that spins out two threads that perform some database tasks. I tested the application on Tomcat and JBoss. It works fine. When I deployed it on WAS, the threads couldn't find datasource to perform database look up.

I also created a simple web service that perform a database task without spinning out a thread like the first scenario. Deployed it on WAS and it worked just fine.

Does anyone has any idea of what could cause this issue? Thanks a lot.
16 years ago
Hi folks.
I'm assigned to look for ways to prevent a user from concurrently logs in to our web application. I.e. we want a user to log in in one session at a given time. Given the technology that my project is using, Java, JSP and Servlet connecting to a security database, I cannot find a clean way to do this. Could anyone point out any resources that I can read up about this subject?
Thank you very much.
21 years ago
Just wanna add to it.
The reason that it calls l2 is because the constructor, N() makes a call to this("@") which will call the constructor, N(String s).
P.m1() is throwing an exception. When you make the call, you will need a try catch block. But on l1, you don't have the try catch block. So you get a compiler error.
JDK 1.3 is a slight change of 1.2. So the exam that you should go for is 1.2. 1.4 exam objectives is different from 1.2 that Sun took out AWT and IO packages. And added in Assertion and more on Collection Framwork.
Good luck on your exam.
Question 9 from www.jiris.com Exam 1 asks:
What is the output of trying to compile and run the following?

1: public class Test009 extends T
2: {
3: public static void main(String args[])
4: {
5: Test009 t = null;
6: T tt = (T)t;
7: System.out.print(t);
8: System.out.print(" ");
9: System.out.println(tt);
10: }
11: }
12:
13: class T{}
The answer is code compiles and run with output: null null.
My question is why it is legitimate to type cast a null object reference (line 6) since there's no object exists?
Thank you very much
When study for Java Exam, I go over topics according to objectives. But I'd like to know if the exam will cover methods others than those listed in the objectives? I.e. rint() is not listed for java.lang.Math class, will there be any question on it?
Thank you so much
Thanks a lot, Valentine, for the great explaination.
I found that Byte, Short, Integer and Long all have parseXXX(String s, int radix) method. I tested with a String and found that they return the same output.

I try different values of the String and these are what I think happen:
1. parseXXX() method checks for the range of the String at runtime. If the string contains integer value greater than XXX.MAX_VALUE or less than XXX.MIN_VALUE, NumberFormatException is thrown.
2. String s must contains only digits 0-9. And if the digit is not in an acceptable range of the radix, NumberFormatException is thrown at runtime. i.e. with the above example, the exception is thrown if the radix is 2 instead of 8 because base 2 contains digits 0 and 1 only.
Am I right?
Suresh,
Try this. I added some more codes to the program to help see what happens when it executes so you can get a better idea of how continue and break work. -- Got the idea from Dan Chrisholm's exams.
Ron,
From what I understand, Sun launched a beta exam back in April/May/June time frame. I believe that it's free. Unfortunatly, it was closed sometime in June. It was later when I found out about it too.
Veena, I tried the code and didn't get any compiler error. The code prints:
1
2
3
4
[ August 15, 2002: Message edited by: May Pat ]
I think what Megan is trying to ask is with her sample codes, why does she get a compiler error saying that "call to super must be first statement in constructor"? From what I understand, super() seems to be the first thing in the code, not counting try statement. Or does the compiler expect to see super() to literally be on the very first line of the constructor?
And what if I have the following codes:

Since Parent's constructor is throwing exception and Child() is calling super(), I'd think that I need to have super() in try-catch block. But I got compiler error. Is it that if the parent's constructor is throwing exception, the exception needs to be thrown to who ever calls the child's constructor and not catching it inside of the constructor?
Hope my question is not too confusing.
Where can I find the 1.4 beta mock exam? Thank you very much.
Could anyone explain why don't we need explicite casting when assigning long value to a float since long is 64 bits and float is only 32 bits?
Thank you.