Which of the following are legal lines of Java code? 1. int w = (int)888.8; 2. byte x = (byte)100L; 3. long y = (byte)100; 4. byte z = (byte)100L;

🎲 Try a Random Question  |  Total Questions in Quiz: 63  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
Java Basics Practice Test: Data Types, Variables and Arrays — practice the complete quiz, review flashcards, or try a random question.

Quiz on integer, character, floating and boolean data types, variables, type casting and conversions and properties of arrays. Java has two types of data types: primitive data types and reference data types. Primitive data types are the basic data types that are built into the Java language. There are eight primitive data types in Java: byte: A byte is an 8-bit signed integer. short: A short is a 16-bit signed integer. int: An int is a 32-bit signed integer. long: A long is a 64-bit signed integer. float: A float is a 32-bit floating-point number. double: A double is a 64-bit... Show more

Which of the following are legal lines of Java code?<br> 1. int w = (int)888.8;<br> 2. byte x = (byte)100L;<br> 3. long y = (byte)100;<br> 4. byte z = (byte)100L;