Need code translation!

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!
snajalmAsked:
Who is Participating?
 
for_yanCommented:
if line has length of zero (like string "") then k = 0 otherwise k = wioll be resuly of parsing line as integer minus 1
0
 
for_yanCommented:
if line =="" then k =0
if line = "25" then k = 24
0
 
snajalmAuthor Commented:
Many Thanks for accurate and prompt replt!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.