?
Solved

Need code translation!

Posted on 2011-10-05
3
Medium Priority
?
301 Views
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!
0
Comment
Question by:snajalm
  • 2
3 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 1000 total points
ID: 36922388
if line has length of zero (like string "") then k = 0 otherwise k = wioll be resuly of parsing line as integer minus 1
0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 1000 total points
ID: 36922393
if line =="" then k =0
if line = "25" then k = 24
0
 

Author Closing Comment

by:snajalm
ID: 36922402
Many Thanks for accurate and prompt replt!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month15 days, 20 hours left to enroll

850 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