/    Sign up×
Community /Pin to ProfileBookmark

reurns null constantly

bassically bellow is two sections of my code. the code is used to tell a user if a company has the car in stock to meet there needs.
now the top section is for model and works fine as do all the other text ones however the second section deals with floating numbers and returns the value null constantly. any ideas? cyaz andy

String model = searchSpec.model.toLowerCase();
if ((model != null) && (!model.equals(“”)) &&
(!model.equals(this.model.toLowerCase())))
{System.out.println(“not model”);return false;}

Float engineSize = searchSpec.engineSize;
if ((engineSize != null) && (!engineSize.equals(“”)) &&
(!engineSize.equals(this.engineSize)))

to post a comment
Java

1 Comments(s)

Copy linkTweet thisAlerts:
@potterd64May 04.2007 — You'd have to look at where searchSpec.engineSize is set in order to see why it's null. Also is engineSize supposed to be a float or a Float? You have it as a Float, which is an object, but it may be easier to represent it as a float, which is a primitive type like an int.
×

Success!

Help @ajkiwi88 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...