Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Boxing confuses

 
Senthil Kumaran
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, somebody explain me this program, especially line 9, this question from Inquisition scjp6 trail set mock exam,




the answer is {aaa=2,bbb=1,ccc=1}

is that question mark in line 9 is printing mistake, if it is, i cant understand that boxing & unboxing clearly,

(Jesper Young: Corrected code tags)
 
Paul Stat
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest you look up the "ternary" operator again
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not cross post.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15435
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Locked the topic in the Beginner forum, since this is a question that's relevant to SCJP.
 
Stephen Davies
Ranch Hand
Posts: 352
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think within your ternary statement you need to put ... ...otherwise it won't compile.

 
Byju Joy
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
M in TreeMap and S in System gotta be in CAPS.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic