Solved

new Integer question ...

Posted on 2006-07-10
3
186 Views
Last Modified: 2010-03-31
Hi experts,

  Is there a way to fix the following line?

        Integer IntA = new Integer(int a = (b<c) ? b: c);

  Due to the technique difficulty, I am unable to make them to two lines ...

 thanks.
0
Comment
Question by:meow00
  • 2
3 Comments
 
LVL 92

Expert Comment

by:objects
ID: 17077953
do you mean to assign a? if so, I don't think so

        Integer IntA = new Integer((b<c) ? b: c);
0
 
LVL 92

Accepted Solution

by:
objects earned 300 total points
ID: 17077955
or:

        Integer IntA = new Integer(Math.min(b, c));
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 17078071
or this

int a ;
Integer IntA = new Integer( ( a = b < c ? b : c ) ) ;
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Image decoding from Camera 3 72
maven project error 5 48
Apps blocked by Java 9 60
couple of eclipse 5 21
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

911 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

22 Experts available now in Live!

Get 1:1 Help Now