Question
class conversion
{
public static void main(String args[])
{
double a = 295.04;
int b = 300;
byte c = (byte) a;
byte d = (byte) b;
System.out.println(c + " " + d);
}
}
a.
38 43
b.
39 44
c.
295 300
d.
295.04 300
Posted under Java Programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this program?
Similar Questions
Discover Related MCQs
Q. Which of these operators is used to allocate memory to array variable in Java?
View solution
Q. Which of these is an incorrect array declaration?
View solution
Q. Which of these is an incorrect Statement?
View solution
Q. Which of these is necessary to specify at time of array initialization?
View solution
Q. Generics does not work with?
View solution
Q. How to sort an array?
View solution
Q. How to copy contents of array?
View solution
Q. Can you make an array volatile?
View solution
Q. Where is array stored in memory?
View solution
Q. An array elements are always stored in ________ memory locations?
View solution
Q. What is the range of short data type in Java?
View solution
Q. What is the range of byte data type in Java?
View solution
Q. An expression involving byte, int, and literal numbers is promoted to which of these?
View solution
Q. Which of these literals can be contained in float data type variable?
View solution
Q. Which data type value is returned by all transcendental math functions?
View solution
Q. How to format date from one form to another?
View solution
Q. How to convert Date object to String?
View solution
Q. How to convert a String to a Date object?
View solution
Q. Is SimpleDateFormat thread safe?
View solution
Q. How to identify if a timezone is eligible for DayLight Saving?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Java Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!