Win a copy of Spring Boot in Practice this week in the Spring forum!

Paul Caudle

Ranch Hand
+ Follow
since Jun 08, 2000
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 Paul Caudle

okay, well, being my crazy self I seem to have answered my own question here but want to put it out there for someone to read over, perhaps.
A unidirectional driver will ditch the rows of information after they are read while a bi-directional driver would keep the rows of info contained within the RS for the purposes of navigating back.
So performance vs. ease of use?
Okay, so I hear that ODBC is Unidirectional. What are the advantages and disadvantages of such a thing?
Thanks in Advance for your help.
PS-Been a while since I've been in here. Looks great. Keep up the fine work rancheroos!
Hiya Peter,
Thanks for the explanation. It makes sense after thinking through it. So not only does the object not have values for any member variables, but it does not contain the possibility for having values because member variables don't exist.
Seems like an obvious solution to multithreading woes, but it may end up being a little taxing with all of the local variables that may be used.
Thanks again for the Response, Peter.
PS...where is Mary when you need her?
21 years ago
So I've heard of stateless objects in VB (shudder with fear and disgust) but I have not heard of them in Java...until now. In discussion with someone they brought it up so I put it forth:
What is a stateless object in Java (if there is such a thing) and what is it used for (or when does it occur)?
Thanks for your help, all.
Have a good one.
21 years ago
Hey there JiaPei,
I got it to work simply by capitalizing the S in string in the method header of sM1(String s).
Let me know if that doesn't work for you.
It's a bug in Java that Sun doesn't feel like fixing...I'm not sure exactly why...perhaps someone a little more Sun saavy could explain why.
Other than that, though, Java is a fantastic language, really!
21 years ago
Answer posted in reply to your question in the beginner's forum.
21 years ago
No Worries, Sean, a different perspective always helps, eh?
21 years ago
Hi Tom,
A null String means there is no string object, even...just null. An empty String on the other hand, is a String object simply storing the String: ""
I like to think of it as the difference between nothing (null) and 0 (empty String).

So this would have reference to a null String:
String s1 = null;
(or if at class level String s1).
and this would have reference to an empty String:
String s2 = "";
I hope that helps.

21 years ago
that's funny, Grant...agreed about the minds, too
21 years ago
Here's an example:
in a method somewhere:
String numWord = JTextField1.getText();
double num;
//Attempt to convert to a number
num = Double.parseDouble(numWord);
catch(Exception e){
//tell the user if it wasn't a number
JOptionPane.showMessageDialog(this, "Not a valid Number");
//exit the method
//here you can do whatever it is you were going to do with that number

That might shed some light on the convoluted explanation from before
21 years ago
Hi Cindy,
Java 2 has a static method of the Double class called parseDouble that takes a String argument and returns a double.
If the String argument cannot be converted into a double, it throws a NumberFormatException.
If you put the Double.parseDouble("5.6") in a try block then an Exception will be thrown to your catch block. If the parse was successful, no exception will be thrown.
Let me know if that was too complicated or if you have found an easier way to do it (That would be great).
Hope that helps.
21 years ago
Can one object access a private variable of another object of the same class?
<h6>it only took me about 2 minutes to find it...but I got a lot of the questions wrong in the meantime</h6>
The answer to this question is Yes, it can. I think the explanation of this answer in the round-up is that the access is granted to the class, not the object...
To explain that a little further, any object created from a specific class has access to the private variables of any other object created from that class.
Take a look:

Even though there are 2 different objects here (referenced using x and b) b is still able to access the private variable of object x. Why? Because the objects referenced by x and b were both created from the same class (Sharing), and objects created from the same class have access to each other's privates ( get your mind out of the gutter, you know what I mean!).
I hope that helps...send me an e-mail if you want a little clarification and I'll post it up here.

[This message has been edited by Paul Caudle (edited November 13, 2000).]
21 years ago