Search the courses, subjects, tracks, games and features, or jump straight to a page.
5 cards from this section. Quick, good the night before a test.
What is the output of int a = 10; double b = a;?
Think about how an int becomes a double.
Convert float value = 12.34F; to an int. What would be the code?
Remember to cast the float to an int.
What is implicit conversion?
Think about how the compiler handles smaller to larger data types.
True or False: Explicit conversion can lead to data loss.
Consider the examples of casting discussed.
Write a Java program that demonstrates both implicit and explicit conversions with at least two different types.
Look for examples of widening and narrowing in your code.
Explain what will happen if you try to cast a String to an int in Java.
Think about type compatibility in Java!
6 more questions in this section. Enroll free to practise them all.
Enroll free