Home

What is the correct answer?

4

Consider the following statements:
int x = 10, y = 15; 
x = ((x < y) ? (y + x) : (y - x);

What will be the value of x after executing these statements?

A. 25

B. 15

C. 5

D. Error can't be executed.

Correct Answer :

A. 25


Related Questions

Which of the following are the wrapper classes? What is error in the following class definitions? abstract class… If you want to assign a value of 99 to the variable year, then which of… A final class may not have any abstract method. When we implement the Runnable interface, we must define the method Which of the following methods can be used to remove a component from… When present, package must be the first no comment statement in the file. The check box group class is a subclass of the component class. Which are the valid ways to create DataInputStream streams? Submit button always fires doPost(...) Message-Driven beans act as a listener for the Java Message Service API,… forName() is a static factory method Frames and applets cannot be used together in the same program. The use of protected keyword to a member in a class will restrict its… A package is a collection of We would like to make a member of a class visible in all subclasses regardless… When we invoke repaint () for a Component, the AWT invokes the method: All methods in an abstract class must be declared abstract. What does the following line of code do?TextField text=new TextField(10); A panel can not be added to another panel. Which javadoc tag is used to denote a comment for methods parameters? The methods wait() and noify() are defined in Which key word can protect a class in package from accessibility by the… Which of the following are not keywords? What is java -g used for? JSP files creates ________________ Which of the following methods can be used to change the size of a size()… An individual array element that is passed to a method and modified in… It is an error to have a method with the same signature in both the super… Declarations can appear anywhere in the body of a Java method.