Need code translation!

Posted on 2011-10-05
Last Modified: 2012-05-12
Could someone translate this line of code for me!  Is it some sort of "IF" statement?!

k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1;

Thanks in advanced!
Question by:snajalm
    LVL 47

    Accepted Solution

    if line has length of zero (like string "") then k = 0 otherwise k = wioll be resuly of parsing line as integer minus 1
    LVL 47

    Assisted Solution

    if line =="" then k =0
    if line = "25" then k = 24

    Author Closing Comment

    Many Thanks for accurate and prompt replt!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Introduction This warning has to be one of the most commonly issued warnings in the history of PHP.  The article explains why this warning arises and what to do to mitigate the problem. How this Happens HTTP headers include many different kinds…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
    This video teaches viewers about errors in exception handling.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now