Paul Caudle

Ranch Hand
+ Follow
since Jun 08, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

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?
p
Okay, so I hear that ODBC is Unidirectional. What are the advantages and disadvantages of such a thing?
Thanks in Advance for your help.
p
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.
Paul
PS...where is Mary when you need her?
23 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.
Paul
23 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.
Paul
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!
Paul
23 years ago
Answer posted in reply to your question in the beginner's forum.
23 years ago
No Worries, Sean, a different perspective always helps, eh?
23 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.
Paul

23 years ago
that's funny, Grant...agreed about the minds, too
23 years ago
Here's an example:
in a method somewhere:
String numWord = JTextField1.getText();
double num;
try{
//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
return;
}
//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
Paul
23 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.
Paul
23 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).]
23 years ago