|
INTERVIEW QUESTIONS
J2EE
JAVA
DETAILS
Question: What is numeric promotion?
Answer: Numeric promotion is the conversion of a smaller numeric type to a larger numeric type,so that integer and floating-point operations may take place. In numerical promotion, byte, char, and short values are converted to int values. The int values are also convertedto long values, if necessary. The long and float values are converted to double values, as required.
|
|
|
Category |
Java Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 8913 users |
Added on |
10/18/2009 |
Views |
71135 |
Rate it! |
|
|
Question:
What is numeric promotion?
Answer:
Numeric promotion is the conversion of a smaller numeric type to a larger numeric type,so that integer and floating-point operations may take place. In numerical promotion, byte, char, and short values are converted to int values. The int values are also convertedto long values, if necessary. The long and float values are converted to double values, as required. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What is the difference between a Scrollbar and a ScrollPane?
|
View Answer
|
|
What is the difference between a public and a non-public class?
|
View Answer
|
|
To what value is a variable of the boolean type automatically initialized?
|
View Answer
|
|
Can try statements be nested?
|
View Answer
|
|
What is the difference between the prefix and postfix forms of the ++ operator?
|
View Answer
|
|
What is the purpose of a statement block?
|
View Answer
|
|
What is a Java package and how is it used?
|
View Answer
|
|
What modifiers may be used with a top-level class?
|
View Answer
|
|
What are the Object and Class classes used for?
|
View Answer
|
|
How does a try statement determine which catch clause should be used to handle an exception?
|
View Answer
|
|
Can an unreachable object become reachable again?
|
View Answer
|
|
When is an object subject to garbage collection?
|
View Answer
|
|
What method must be implemented by all threads?
|
View Answer
|
|
What methods are used to get and set the text label displayed by a Button object?
|
View Answer
|
|
Which Component subclass is used for drawing and painting?
|
View Answer
|
|
What are synchronized methods and synchronized statements?
|
View Answer
|
|
What are the two basic ways in which classes that can be run as threads may be defined?
|
View Answer
|
|
What are the problems faced by Java programmers who don't use layout managers?
|
View Answer
|
|
What is the difference between an if statement and a switch statement?
|
View Answer
|
|
What happens when you add a double value to a String?
|
View Answer
|