-
Notifications
You must be signed in to change notification settings - Fork 1
Module 1 Mastery Check
wolvesled edited this page Aug 28, 2013
·
2 revisions
- 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.
- What are the three main principles of object-oriented programming? Answer: Encapsulation, Polymorphism and Inheritance.
- Where do Java programs begin execution? Answer: main() method.
- What is a variable? Answer: an item in Java that can store a grasp kinds of data and for changes.
- Which of the following variable names is invalid? A. count B. $count C. count27 D. 67count <- Answer
- 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.
- 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;
- How do you create block of code? Answer: a pair of curly braces.
- The moon's gravity is about 17 percent that of earth's. Write a program that computes your effective weight of the moon.
- 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.)
- If you make a typing mistake when entering your program, what sort of error will result? Answer: Java compile error.
- Does it matter where on a line you put a statement? Answer: No.