Java Chapter 1 (1.4-1.6)

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

What is Java bytecode?

A low-level representation of a Java source code program. The Java compiler translates the source code into bytecode, which can then be executed using the Java interpreter. The bytecode might be transported across the Web before being executed by a Java interpreter that is part of a Web browser.

Suppose a program requires an identifier to represent the sum of the test scores of a class of students. For each of the following names, state whether or not each is a good name to use for the identifier. a)x b)scoreSum c)sumOfTheTestScoresOfTheStudents d)smTstScr

B

Which of the following are not valid Java identifiers? Why? a) RESULT b) result c) 12345 d) x1234y e) black&white f) answer_7

C & E

What type of error is this? Misspelling a Java reserved word?

Compile-time error

What is white space? How does it affect program execution? How does it affect program readability?

White space is a term that refers to the spaces, tabs, and newline characters that separate words and symbols in a program. The compiler ignores extra white space; therefore, it doesn't affect execution. However, it is crucial to use white space appropriately to make a program readable to humans.

Printing a student's high test grade when the student's average test grade should have been output

Logical error

Where does processing begin in a Java application

The processing of a Java application begins with the main method.

Calculating the average of an empty list of numbers by dividing the sum of the numbers on the list (which is zero) by the size of the list (which is also zero)

Run-time error

When was the Java programming language developed? By whom? When was it introduced to the public?

The Java programming language was developed in the early 1990s by James Gosling at Sun Microsystems. It was introduced to the public in 1995.`

What do you predict would be the result of the following line in a Java program? System.out.println("Hello"); //prints hello

The characters "Hello" will be printed on the computer screen.

What do you predict would the result of the following line in a Java program? //prints hello System.out.println("Hello");

The entire line of code is a comment, so there is no result.


संबंधित स्टडी सेट्स

CH 7 International Arbitrage and Interest Rate Parity

View Set

Chapter 7 - Language of Medicine Online Questions & Answers & TB

View Set

Unit 3: Financial Statements: Module 3: Financial Statements Overview, Lesson 9: The Income Statement, Lesson: 10: The Statement of Retained Earnings, Lesson 11: The Statement of Cash Flows, Lesson: 12: The Statement of Cash Flows, Module 3 Quiz

View Set

pediatric musculoskeletal (not PP)

View Set

Part 2: Topic 12: Absolutism and The French Revolution (1550-1850)

View Set