Skip to content

Module 1 Mastery Check

wolvesled edited this page Aug 28, 2013 · 2 revisions
  1. What is byte code and why is it important to Java's use for Internet programming? Answer: bytecode is kind of execution code for Java VM, it is optimized for security and portability which is very important for Internet programming.
  2. What are the three main principles of object-oriented programming? Answer: Encapsulation, Polymorphism and Inheritance.
  3. Where do Java programs begin execution? Answer: main() method.
  4. What is a variable? Answer: an item in Java that can store a grasp kinds of data and for changes.
  5. Which of the following variable names is invalid? A. count B. $count C. count27 D. 67count <- Answer
  6. How do you create a single-line comment? How do you create a multiline comment? Answer: double forward slash for single line comment, multiline comments start with a forward slash followed by an asterisk and ends with an asterisk followed by a forward slash.
  7. Show the general form of the if statement. Show the general form of the for loop. Answer: if (condition) statement; for (initialization; condition; iteration) statement;
  8. How do you create block of code? Answer: a pair of curly braces.
  9. The moon's gravity is about 17 percent that of earth's. Write a program that computes your effective weight of the moon.
  10. Adapt Project 1-2 so that it prints a conversion table of inches to meters. Display 12 feet of conversions, inch by inch. Output a blank line every 12 inches.(one meter equals approximately 39.37 inches.)
  11. If you make a typing mistake when entering your program, what sort of error will result? Answer: Java compile error.
  12. Does it matter where on a line you put a statement? Answer: No.

Clone this wiki locally