This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.

Bart Wilson

Greenhorn
+ Follow
since Aug 01, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Bart Wilson

This is what I got so far, am I on the right track?
Set entries = someObject.getItems().entrySet();
Iterator iterator = entries.iterator();
while (iterator.hasNext())
{
Map.Entry entry = (Map.Entry)iterator.next();

}
[This message has been edited by Bart Wilson (edited November 13, 2001).]
23 years ago
I need help on how to proceed this. I need to iterate through a hash map.
Thanks
23 years ago
Yes if it equals null I want to equal something other than null.
Thanks

Originally posted by Chad McGowan:
Short s;
if (s == null)
Is this what you are asking?


23 years ago
How do you check for null for Short type?
I can't use 0 (zero).
???
Thanks
23 years ago
What do mean to add 2? Is this why I am being thrown a catch error? I edited the substring(0,indexOf(",")) to
substring(0, indexOf(",", -1)) to make it search from -1, didn't work still had a catch error.
Thanks
23 years ago
Is this correct? substring not subString, right?
I want strLastName to only equal the characters that precedes a comma (,):
strLastName = name.substring(0,name.indexOf(",")
This would extract characters after the comma to the end of the index:?
strFirstName = name.substring(name.indexOf(","))
Thanks.
23 years ago
Great job guys! Didn't expect it to be so heavy.
The classes are categories not java classes.
The value of the combination of these two classes is derived. The user does not enter it on the form. The values come from the database.
A 9/10 class is not the same as a 9 class and a 10 class.
A 9/10 class may have some items of 9 class and 10 class and it may have additional stuff that are not in 9 or 10. Confusing? Yes. But I don't question the business rules and policies. Just doing what they want and having them as Strings make more sense.
Great job!
Thanks
23 years ago
Here is a real simple question for someone simple minded as I am.
How do you get the first character of a string?
.substring(0) ???
or
.substring(1)???
I want to extract the first two
Thanks
23 years ago
Mike:
The value is a String comprised of two Strings
for example
strClass = strPrimaryClasss + "/" + strSecondaryClass
strClass could equal 9/10 or 9 only or 10 only.
There is a third String that would indicate whether strClass is just a primary, secondary or combination of both classes.
That's why it's a String, no calculations are done on these values.
Thanks.

Originally posted by Mike Curwen:
Bart, you are doing a calcuation. You are calculating whether the entered number is not less than 1 and not greater than 9.


23 years ago
It is a string because it does not involve calculations. It's a value getting off of a form.
Thanks.

Originally posted by Paul Stevens:
Why not just convert them to int and do your compare.


23 years ago
I have a method that returns a String value. The values are only valid if it is 1-9. How do you do determine greater than and less than of a String?
for example: (I know this does not work)
if (myString.getString() > "0" && myString.getString < "10")
{
doSomething;
}
Thanks for any suggestions.
23 years ago
Please help me translate this shortcut code. I keep getting a null pointer exception. How do I check for a null pointer for a boolean?
<%=thisObject.isRequired()? "YES" : "NO"%>
Thank you for any help.
23 years ago
Figured it out the method is booleanValue()

Originally posted by christopher foran:
It returns a Boolean class. The Boolean class is not the same as the boolean primate. There is a method on the Boolean class which returns true/false.


23 years ago
If you have a return type Boolean what does this return, does it returns true/false like the primimtive boolean?
public java.lang.Boolean getIndicator()
{
return mIndicator;
}
23 years ago
Map
What is exactly a map and how does it work? Does it has something to do with extracting data and matching field names to their values???
23 years ago