<< Chapter < Page | Chapter >> Page > |
Revised: Mon Mar 28 13:31:46 CDT 2016
This page is included in the following Books:
This module contains review questions and answers keyed to the module titled Jb0200: Java OOP: Variables .
The questions and the answers are connected by hyperlinks to make it easy for you to navigate from the question to the answer and back again.
Write a Java application that reads characters from the keyboard until encountering the # character. Echo each character to the screen as it is read.Terminate the program when the user enters the # character.
What is the common name for the Java program element that is used to contain data that changes during the execution of the program?
What must you do to make a variable available for use in a Java program?
True or false? In Java, you are required to initialize the value of all variables when they are declared.
Show the proper syntax for declaring two variables and initializing one of them using a single Java statement.
True or false? The Java compiler will accept statements with type mismatches provided that a suitable type conversion can be implemented by the compiler atcompile time.
Show the proper syntax for the declaration of a variable of type String[] in the argument list of the main method of a Java program and explain its purpose.
Describe the purpose of the type definition in Java.
True or false? Variables of type int can contain either signed or unsigned values.
What is the important characteristic of type definitions in Java that strongly supports the concept of platform independence of compiled Java programs?
What are the two major categories of types in Java?
What is the maximum number of values that can be stored in a variable of a primitive type in Java?
List the primitive types in Java.
True or false? Java stores variables of type char according to the 8-bit extended ASCII table.
True or false? In Java, the name of a primitive variable evaluates to the value stored in the variable.
True or false? Variables of primitive data types in Java are true objects.
Why do we care that variables of primitive types are not true objects?
What is the name of the mechanism commonly used to convert variables of primitive types to true objects?
How can you tell the difference between a primitive type and a wrapper for the primitive type when the two are spelled the same?
Notification Switch
Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?