Log In Register

Units


Type Conversions, Promotions And Castings - Questions and Answers

 

Practice these Type Conversions, Promotions And Castings under Java Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on Type Conversions, Promotions And Castings for following purpose.


– Anyone who is wishing to increase their perfect knowledge of Type Conversions, Promotions And Castings of Java Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge Java Programming specifically  Type Conversions, Promotions And Castings.
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on Type Conversions, Promotions And Castings under Java Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of   Type Conversions, Promotions And Castings topic of Java Programming:

 

1. If an expression contains double, int, float, long, then whole expression will promoted into which of these data types?

Answer: Option C

Explanation:
If any operand is double the result of expression is double.

2. What is the error in this code? byte b = 50;

Answer: Option B

Explanation:
While evaluating an expression containing int, bytes or shorts , the whole expression is converted to int then evaluated and result is also of type int.

3. What is the prototype of the default constructor of this class? public class prototype { }

Answer: Option D

Explanation:

4.  Which of these is necessary condition for automatic type conversion in Java?

Answer: Option B

Explanation:

5. What is Truncation is Java?

Answer: Option A

Explanation: