Module 4 Flashcards
Which of the following are true about arithmetic expressions?
A. Subtraction is always done after addition
B. 1 + 2 * 3 is equal to 7
C. Multiplication is always done before addition
D. 6 + 4 / 2 is equal to 5
E. 5 * 4 / 4 - 1 is equal to 6
B. 1 + 2 * 3 is equal to 7
C. Multiplication is always done before addition
What is a Java Virtual Machine (JVM)?
A. an editor specific to Java
B. a complier
C. a psuedo code generator
D. a language run-time environment
D. a language run-time environment
Given two variables x and y, which code below swaps the current values of x and y?
A. y = x ; x = y;
B. x = y; y = x;
C. t = x; x = y; y = t;
D. t = x; y = x; y = t;
C. t = x; x = y; y = t;
Which of the following are derived data types in the Java language?
A. double
B. char
C. []
D. indirection
E. String
C. []
E. String
Which of the following statements are true regarding an Interactive Development Environment (IDE)? (Check all that apply)
A. An IDE expedites the resolution of runtime problems
B. An IDE is a burden to programmers, but produces faster code
C. An IDE generates algorithms for the programmer
D. An IDE contains access to an editor and a complier so that the programmer can cycle through these steps iteratively and easily before proceeding outside to the runtime environment
A. An IDE expedites the resolution of runtime problems
Which of the following are valid Java variable names?
A. Year2011
B. OVER_THE_TOP
C. over_the_top
D. $MINIMUM
E. 2for_one_sale
A. Year2011
B. OVER_THE_TOP
C. over_the_top
D. $MINIMUM
Which of the following statements are true regarding interpreters?
A. They use a three step approach of edit, compile, and run
B. They recompile each statement every time the program runs
C. They use a two step approach that combines the compile and run steps into one step
D. The source code file and the executable file are the same
E. Once a program runs perfectly, interpreters are faster than non-interpretive language programs
B. They recompile each statement every time the program runs
C. They use a two step approach that combines the compile and run steps into one step
D. The source code file and the executable file are the same
Which of the following are true about Java assignment statements?
A. In a Java assignment statement there can be multiple variables and constants on the left of the assignment operator
B. Java assignment statements use the = operator
C. Java assignment statements can have an arithmetic expression on the right of the assignment operator
D. A Java assignment statement is the same as an algebraic equality statement
B. Java assignment statements use the = operator
C. Java assignment statements can have an arithmetic expression on the right of the assignment operator
Which of the following statements are true regarding the following Java statement? average = (x + y)/2.0
A. This statement contains two variables
B. This statement is an assignment statement
C. If the values of all variables in this statement was always guaranteed to be a round number, all variables would best be defined as integer
D. This statement is an algebraic equality statement
B. This statement is an assignment statement
What is a void method in Java?
A. One that requires no inputs
B. One that is called “main”
C. One that requires no static memory
D. One that returns no data
D. One that returns no data
What does a Java compiler generate?
A. source code
B. object code
C. byte code
D. psuedo code
E. machine language
C. byte code
Which of the following are valid Java declarations and initializations of variables?
A. boolean true = yes;
B. constant PI = 3.1416;
C. int x = 1000000;
D. char n = “Hello”;
E. short x = 4.26;
C. int x = 1000000;
If c equals negative two, what does an equal in the following Java statement?
a = 2 + c++
A. 6
B. 1
C. -2
D. 0
E. 2
D. 0
Which of the following statements are true about Java?
A. Java does not support objects
B. The Java compiler generates machine code
C. A Java program runs on a Java Virtual Machine
D. Java was developed for embedded applications
E. Java was developed at IBM
C. A Java program runs on a Java Virtual Machine
D. Java was developed for embedded applications
Which of the following Java statements correctly declares a constant?
A. double mORTGAGE_RATE = 3.5;
B. final double MRATE = 3.5;
C. constant mORTGAGE_RATE = 3.5;
D. constant MRATE = 3.5;
B. final double MRATE = 3.5;