Module 4 Flashcards
Which of the following are true regarding the Java method main?
A) In the declaration of main, the term “public” means that the main method is available from anywhere within the program.
B) The method main is called by the Java Virtual Machine when the program is started.
C) The method main is called by the Java compiler.
D) In the declaration of main, the term “static” means that the main method exists in memory and can be executed without creating an object.
B) D)
Which of the following is a valid method header for the “main” method required in each Java application?
A) public static void main (String args)
B) public static int main (String [] args)
C) private static void main(String [] args)
D) public void main (Strings [] args)
E) public static void main ( String [] args)
E)
Which of the following languages is interpretive?
A) BASIC
B) GRASP
C) C++
D) Java
A)
Which of the following are primitive Java data types?
A) double
B) String
C) array
D) int
E) integer
A) D)
Please select all of the following statements which apply to the Eclipse Integrated Development Environment (IDE).
A) Eclipse must be used to develop and run Java programs.
B) Eclipse replaces the Java Virtual Machine.
C) Eclipse is one of many IDEs which may be installed to use the Java language software.
D) The Eclipse IDE facilitates the development of Java programs.
E) Eclipse should be installed on your system after the installation of the Java language system if you are going to use Eclipse for your IDE.
C) D) E)
Which of the following are true about Java string literals?
A) A Java string literal is delimited by single quotes
B) The value of a Java string literal can change
C) When a Java string literal appears within the parenthesis of a println statement it will print out exactly as it appears
D) A Java string literal can contain letters of the alphabet and the digits 0 through 9
C) D)
Java string literals are constants delimited by double quotes. They can contain letters and digits and can be used to describe a string to be printed by the println method.
Which of the following are true regarding the general description of keywords in a computer language?
A) A particular keyword is used only in particular ways in a language.
B) A particular keyword has one or more specialized meanings in the language.
C) Keywords in a language must be recognizable words in a written language.
D) The meaning of a keyword is determined by the context in which it is used in a program.
E) A particular keyword has the same meaning as its equivalent English word.
A) B) D)
Keywords do not have to mimic English words or words in any other language. All other answers are correct.
Which of the following statements are true?
A) Java objects are created at execution (run) time
B) Java objects are created by declaration statements that include the class name and object name
C) Java objects are created by the new operator
D) Java objects are created by a class declaration in the source file
E) Java objects are created by the compiler when you compile your source code
A) C)
Classes are templates or descriptions of objects. The actual object is created at run time by use of the new operator.
The Java SE language system consists of which of the following?
A) a compiler
B) an interpreter
C) a debugger
D) a runtime environment
E) a text editor
A) D)
The Java SE (standard edition) language system consists of two main parts, its compiler, which is known as javac And a run-time environment know as the JRE.
Which of the following Java statements correctly declares a constant?
A) double mORTGAGE_RATE = 3.5;
B) constant mRATE = 3.5;
C) final double MRATE = 3.5;
D) constant MORTGAGE_RATE = 3.5;
C)
Which of the following are characteristics of an algorithm?
A) Creating an algorithm is usually a trivial task
B) A computer program constitues an algorithm
C) Algorithms can assume certain input
D) The steps of an algorithm must be performed in a particular order
E) An algorithm is a sequence of instructions
B) D) E)
Which of the following are true about the Java statement public static void main (String[] args)?
A) It is a class header
B) It is always required in a Java application program
C) You can leave out the word “static” if you like
D) The word “main” is user defined, you can call it anything you like
E) It is a method header
B) E)
The programming process in Java includes which of the following activities?
A) Writing machine code
B) Determining what the program is supposed to accomplish
C) Developing invalid input as test data
D) Resolving all program logic errors
E) Determining program output display
B) C) D) E)
Which of the following are true about logic errors?
A) Logic errors potentially result in incorrect program output
B) Logic errors are detected by the compiler
C) Logic errors must be fixed before testing
D) Logic errors are detected at runtime
E) Logic errors are detected by analyzing the operation of a program
A) D) E)
Which of the following are valid Java variable names?
A) hourly_wage
B) 4tree
C) pay rate
D) Course$Grade
E) house
A) D) E)