Solved

new Integer question ...

Posted on 2006-07-10
3
192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

696 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