What is the correct answer?


In the code below, what data types the variable x can have?

A. byte b1 = 5;

B. byte b2 = 10;

C. x = b1 * b2;

D. int short

Correct Answer :

D. int short

Related Questions

If a=10 and b= 15, then the statement x =(a>b)?a:b; assigns the value… DataInput is Two methods cannot have the same name in Java. Submit button always fires doPost(...) Which of the following represent legal flow control statements? A constructor must always invoke its supper class constructor in its first… Which of the following statements are true? Servlet has ___________ executeUpdate automatically updates data because___________ Which javadoc tag is used to denote a comment for methods parameters? Which exception is thrown by the read() method of InputStream class? A panel can not be added to another panel. If a=10 and b= 15, then the statement x =(a>b)?a:b; assigns the value… It is perfectly legal to assign a subclass object to a supper class reference. The default case is always required in the switch selection structure. The keywords reserved but not used in the initial version of Java re: Any method in a supper class can be over ridden in its subclass. All the bitwise operators have the same level of precedence in Java. If you want to assign a value of 99 to the variable year, then which of… A variable declared inside the for loop control can not be referenced… It is an error to have a method with the same signature in both the super… Every call to wait has a corresponding call to notify that will eventually… A catch can have comma-separated multiple arguments. A method declared as static can not access non-static class members. It is an error if a class with one or more abstract methods is not explicitly… If m and n are int type variables, what will be the result of the expression'm… We can over load methods with differences only in their return type. Connection, Statement are interfaces and ResultSet is a class. Which of the following control expressions are valid for an if statement? Java is fully object oriented programme.