What tool translates Java source code into files that contain instructions for the Java Virtual Machine quizlet?
Which of the following refers to a collection of programs that a computer executes? Show a) Software a) software Computers are machines that a) design computer programs. b) execute programs. Computer programming is a) the speed with which a computer operates. d) the act of designing and implementing a computer program Consider the following statements regarding computers: I. Computers can execute a large number of instructions in a fraction of a second. Which one of the following options is correct? a) Only III is a valid statement. d) I, III, and IV only are valid statements. Consider the following statements about computer programs: I. Computer programs can be written by someone who has a basic knowledge of operating a computer. Which one of the following options is correct? a) II and III only are correct statements. c) II, III, and IV only are correct statements.
The Central Processing Unit is primarily responsible for a) performing program control and data processing. a) performing program control and data processing. A single silicon chip made from potentially millions of transistors is called a) a Central Processing Unit (CPU). a) a Central Processing Unit (CPU). An example of an output device that interfaces between computers and humans is a) a keyboard. c) a speaker. An example of an input device that interfaces between computers and humans is a) a microphone a) a microphone Programs that are not running are usually stored a) in the CPU's memory. c) in secondary storage. When a program begins to run, a) It is moved from DVD to hard disk. b) It is moved to the CPU's memory. Which one of the following typically provides data persistence without electricity? I. The CPU's memory a) I, II only c) II, III only Consider a scenario in which you develop a Java program on a computer that has a Pentium processor. What step should you take to run the same Java program on a computer that has a different processor?
a) The compiled Java machine language instructions can be run on any processor that has a Java Virtual Machine. a) The compiled Java machine language instructions can be run on any processor that has a Java Virtual Machine. High-level programming languages a) Are made up primarily of ones and zeros b) Are independent of the underlying hardware Which one of the following translates high-level descriptions into machine code? a) Assembler c) Compiler Computer scientists have devised something that allows programmers to describe tasks in words that are closer to the syntax of the problems being solved. This is called a(n) a) Embedded system c) High-level programming language Small applications written in the Java programming language that can be located anywhere on the Internet are called a) Applets a) Applets What is one of the benefits of using a high-level programming language like Java? a) Its syntax is very similar to the hardware instruction set d) Problems solved in a high-level language are independent of the underlying computer hardware Because Java was designed for the Internet, which two of its attributes make it suitable for beginning programmers? a) Efficiency and portability c) Safety and portability An integrated development environment (IDE) bundles tools for programming into a unified application. What kinds of tools are usually included? a) An editor
and a compiler a) An editor and a compiler Which of the following are reasons why Java is good, but not perfect, for beginners? I. A certain amount of technical machinery is necessary to write basic, simple programs a) I, II
only d) I, II, III What is the difference between an editor and a compiler? a) An editor converts program files into an executable program; a compiler allows program files to be written and stored d) An editor allows program files to be written and stored; a compiler converts program files into an executable program Suppose you examine a simple Java program and the first line is public Class HelloPrinter. Is this the same thing in Java as the line public Class helloprinter? a) No, because Java is case-sensitive, these are considered to be completely distinct a) No, because Java is case-sensitive, these are considered to be completely distinct What statements about the integrated development environment (IDE) are true? I. You may run Java class files even after exiting the IDE. a) I, II only d) I, II, III Consider the following statements about folders and your integrated development environment (IDE): I. Hierarchical folders help to organize a project. a) Only I is correct c) Only I and II are correct Which of the following statements regarding backup strategies for Java files are true? I. You should back up your projects often to prevent loss of valuable work. a) I, II only b) I, III only Every Java program consists of one or more a) Values (arguments) b) Classes Characters that are grouped together between double quotes (quotation marks) in Java are called a) reserved words d) strings Every statement in Java must be terminated with a) the semi-colon character ;. a) the semi-colon character ;. These two lines of code do not produce the same output. Why? System.out.println(7 + 3); a) Arithmetic calculations cannot take place within the println method call. c) The quotes cause the second expression to be treated as a string. What is the output from this code snippet? System.out.print("The sum
is "); a) The sum is 10 d) The sum is 7 + 3 Which of the following symbols is used to terminate a Java program statement? a) Colon b) Semicolon Which of the following statements is valid with respect to the usage of a semicolon in Java? a) A semicolon is used to denote the end of a statement. a) A semicolon is used to denote the end of a statement. Which of the following statements is true with respect to the main method in Java? a) The opening and closing parentheses after the method name main are optional. d) Every Java application must have a main method. A Java class with the name Printer has to be saved using the source file name: a) printer.java b) Printer.java Which statement starts the declaration of a class in Java? a) public static void main(String[] args) b) public class Classname Which Java statement prints a blank line? a) public static void main(String[] args) c) System.out.println(); Which Java statement does not contain an error? a) System.out.print(; d) System.out.println(); What is the output of the following code snippet? System.out.print(4 + 4); a) 4 + 412 c) 812 What kind of error is it when your program has a syntax error? a) Compile-time error a) Compile-time error When a compiler finds a syntax error in a program, what happens? a) The compiler goes ahead and produces a Java class file, but leaves out the statement where there was an error. d) The compiler continues and may report about other errors but does not produce a Java class file. What kind of error is created by the following code snippet? System.outt.println("Hello"); a) No error: the code is correct c) Syntax error: the program will not compile What kind of error is created by the following code snippet? System.out.print("The sum of 8 and 12 is "); a) No error: the code is correct b) Logic error: the program does not produce the desired result What is a logic error? a) An error that occurs when a program is running because, for example, the wrong operator was used. a) An error that occurs when a program is running because, for example, the wrong operator was used. How do programmers find exceptions and run-time errors? a) Using the compiler b) Testing by running the program with a variety of input values The programmer, not the compiler, is responsible for testing a program to identify a) Syntax errors c) Run-time errors 47) Which one of the following errors represents a part of a program that is incorrect according to the rules of the programming language? a)
Syntax errors a) Syntax errors Who or what is responsible for inspecting and testing the program to guard against logic errors? a) Programmer a) Programmer While developing a program, the programmer adds the discount amount to the total due instead of subtracting it. What type of an error is this? a) A syntax error b) A logic error Which one of the following methodologies is a sequence of steps formulated in English for solving a problem? a) Flowcharts b) Pseudocode In order to run Java programs on a computer, the computer needs to have software called a(n): a) assembler b) virtual machine In order to translate a Java program to a class file, the computer needs to have software called a(n): a) assembler c) compiler The Java statement public static void main(String[] args) declares a: a) class d) method A Java virtual machine is: a) Software a) Software Which of the following statements must you include in a Java class that can be executed by the virtual machine? a) System.out.println(); c) public static void main(String[] args) What is the output of the following code snippet? System.out.print("Hello"); a) Hello Good Day! c) HelloGood Day! Which one of the following code snippets compiles without errors and displays the output "Hello Good Day!" on the screen? a) System.out.print("Hello "); a) System.out.print("Hello "); What is the output of the following code snippet? public class PrintIt a) 4 * 412 a) 4 * 412 Writing a computer game in Java that has graphics, motion, and sound effects a) is simple because of the power of Java b) requires a team of skilled programmers Which option correctly completes this statement? Programs can repeat simple instructions very quickly to I. help human users to perceive images and sound a) I, II only a) I, II only The ENIAC computer burned out transistors at the rate of a) ten per day d) None - it used vacuum tubes In order for the ENIAC computer to be re-programmed a) vacuum tubes needed to be replaced b) wires needed to be plugged into a different wiring configuration The language developed by Sun Microsystems that became the Java programming language was originally designed to be simple, secure, and a) easy to use in any language c) usable for many different processor types The term "applet" refers to a) a Java program d) a Java program that runs within a web browser Programmers have embraced Java over its closest rival, C++, mainly because a) it is easier to use a) it is easier to use Java is said to be a "safe" programming language. What does this mean? a) Java programs cannot cause environmental damage because they are "green". b) Java programs can run within a browser without fear that they may attack your computer. In order for Java to achieve portability a) compiled Java programs contain instructions for a virtual machine a) compiled Java programs contain instructions for a virtual machine A Java Virtual Machine is a) A theoretical machine to help understand the computational complexity of algorithms b) A program that simulates a real CPU The Java programming language is itself relatively simple, but also contains a vast set of a) syntactical variations d) library packages The source code for a Java program is stored in a file a) that ends with a .class suffix c) that ends with a .java suffix A Java "class" file a) contains Java source code b) contains instructions to the Java virtual machine Which pointers about backing up your Java projects are important? I. Check your backups once in a while a) I, II only b) I, III only Which statements are true? I. In Java, a file can contain at most one public class a) I, II only d) I, II, III The technical term for the values that a method needs in order to carry out its task is an argument. When there is more than one argument needed by a method, they are a) separated by semicolons c) separated by commas In Java, if you want the compiler to interpret what you type as program instructions, you must a) enclose those instructions within quotation marks d) write correct Java statements separated by the semicolon In Java, the statement System.out.print("hello");;; a) is a syntax error b) is a legal statement Sometimes errors throw the compiler off track because a) the compiler does not give up when it finds the first error a) the compiler does not give up when it finds the first error Some run-time errors are so severe that they generate a) an exception a) an exception During program development, errors are a) very rare d) unavoidable If you misspell a word in your Java program it may be true that I. the program will not compile a) I,
II only d) I, II, III Which of these are true about writing algorithms in pseudocode? I. The exact wording is not important a) I, II only b) I, III only A sequence of steps that is unambiguous, executable, and terminating is called a) pseudocode b) an algorithm The first step in describing an algorithm in pseudocode is a) break the algorithm into smaller pieces d) determine the inputs and the outputs What tool translates Java source code into files that contain instructions for the Java Virtual Machine?The Java compiler (javac) converts the source code into bytecode. Bytecode is a kind of average machine language. This bytecode file (. class file) can be run on any operating system by using the Java interpreter (java) for that platform.
What tool translates Java source code into files?DESCRIPTION. The javac tool reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files. It can also process annotations in Java source files and classes.
What does a Java compiler do quizlet?Java uses a compiler to translate that program source code(. java file created by the programmer) into bytecode (. code file). Java then continues and uses an interpreter to translate the bytecode into machine code line by line during execution.
How does Java code translate to machine code?Rather than make you go write machine code, we use a program called a compiler. A compiler translated code written in one language to that written in another language. Thus, a compiler converts Java programs to machine code, which can then be run on the computer.
|