Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7931443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:43:13+00:00 2026-06-03T20:43:13+00:00

I am trying to dig my way through the strict Java methods and operators,

  • 0

I am trying to dig my way through the strict Java methods and operators, but now, trying to ‘translate’ a piece of PHP code to Java (Android), I’m kinda stuck.

In PHP:

if ($row['price']>'0'){
  (.. do something if price is defined - and higher than zero ..)
}

The problem is that $row[‘price’] may be empty (in Java: null?) or contain ‘0’ (zero).
But how can I code that in Java in a smart and not too complicated way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:43:14+00:00Added an answer on June 3, 2026 at 8:43 pm

    Assuming you got the price string in a variable price

    String price = <get price somehow>;    
    try {
        if (price != null && Integer.valueOf(price) > 0) {
            do something with price...
        }
    } catch (NumberFormatException exception) {
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was trying to do some refactoring and messed things up but now don't
I'm trying to understand what is the idiomatic way in Clojure to recurse through
I'm trying to dig up my long-lost PHP skills and have therefore stumbled on
I'm trying to dig into jQuery but would like some feedback on how to
I came across some code written in VS7.1 and now I'm trying to get
I'm trying to dig through some logs and need information before and after the
I am trying to modify some php code and the previous coder has used
I'm trying to dig out what the type of a site is through web
I'm currently trying to dig deep into python and I have found a challenge
Trying to get comfortable with jQuery and I have encountered some sample code that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.