Steve Bradley

+ Follow
since Jun 09, 2004
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Steve Bradley

Wait Bear,

Im reading your note again and I see clearly that the array should be built from the servlet.

Please disregard my recent reply.

17 years ago
Hi Bear,

Thank you for your idea, I tried the first one and it works!!!

If I could ask one more...
Your second suggestion to build an array in the JSP - I like this but how to instruct the array to get values AFTER the submit button is clicked?

Thanks Again,
17 years ago
Hi gang,

I am working on a JSP page that loops through an unknown number of
javabeans and displays descriptions / Quantity in a list format. NoProblems.

User will enter numeric value in textfield provided on each line.

How do I 'capture' the user-data at the time the SUBMIT button is clicked.

Or is this a javascript question?

17 years ago
Hi gang,

Here's one I could use some help with...

I would like to create a new String object which is the value of (char's between parameters) within an existing String object so that....

I've been playing with String.toCharArray and StringBuffer objects...

What is the best route to get from String a to String b?
17 years ago
Thank you so much, I see it now.
This question is from Dan Chisholm's exam 1, section Operators, question 8.

This code prints... 2,true
I am having trouble with the 'true' part. My understanding is that innermost parethesis are computed first (y==((5/3)*3 + (2))) and that /, *, and % have the same level of precedence so I come up with (y==7) which would be false. Where am I going wrong!!!


I've changed your code here slightly to demonstrate something...

By sending the Thread class a runnable target ...Thread t = new Thread(e); you will then have two separate threads running. I believe the Thread class implements Runnable itself - which is why this works.

Hi, this is a Reference Conversion question, from JLS code.

This code throws a Runtime error classCastException. ExamPrep book states that a class reference can be converted to 'Any class with a runtime check' -I don't understand exactly what that means. Why do I get a Runtime Exception here when attempting a narrowing conversion? Point IS - AN Element ?

Steve JLS
Thank you for helping with such an abstract question - please let the sheriff know I am a different Bradley

I was just curious if anyone is aware of a good resource to better understand Compiler vs Runtime Error.

I am getting pretty good at recognizing there will be a problem within a piece of code, but I'm weak (in some areas) when it comes to diagnosing the problem as a Compiler Error vs. Runtime Error.

Thank You.
byte b = 1;
char c = 1;
short s = 1;
int i = 1;

Select the three correct answers.

a. s = b * 2;

b. i = b << s;

c. b <<= s;

d. c = c + b;

e. s += i;

This is a great question, I have part of the answer and I raise an additional question...

Sierra / Bates state: "all operands in a bit shift are promoted to at least an int."

My question is, Does this mean both sides? the term "all operands" certainly indicates that and it provides an explanation for answers b and c.

As for question e. the compound operator excuses you from an explicit cast. An equivalent statement of s = (short)(s + i) would require an explicit cast. Hope this helps.

This question comes from Sierra / Bates chapter 7, question 4.

Which class does not override the equals() and hashcode() methods, inheriting them directly from class object?

A. java.lang.String
B. java.lang.Double
C. java.lang.StringBuffer
D. java.lang.Character
E. java.util.ArrayList

The correct answer is c. I want to understand the logic of this question so that, if necessary, I can answer a similar question from a different list of classes??
I am so grateful for the resources available on this website that I would not be the least bit offended if Dan were to insert a banner ad for his book. I believe Dan's reply to this post was balanced, fair, and effective.

This is a follow up question to Preethi's question earlier today. I am a student. I completed a basic Java course last year - we used SDK1.3

I have some extra time on my hands this summer and I would like to achieve the SCJP designation. I have several quality reference books geared towards 310-025 (SDK1.2)

Moreover, the exam 310-025 is still listed on Sun's website as a viable exam for the designation. Additionally, Sun has maintained links to tutorial packages geared for this older version of java, hence it is still supported.

Is there a really good reason I should discard my materials and upgrade my preparation focus to 310-035 ?

Thank you for being here.
Steve :roll:

I'm not sure what the Rs refers to in your argument to the constructor.

df= new DecimalFormat("Rs, 00,00,000.00");

This call would format the figure in a decimal format and provide a symbol for Japanese Yen...yes I'm getting off track but I was thinking that Rs refers to a foreign currency that is available in unicode?

df= new DecimalFormat(\u00A5###,###.##)