These are all stated as correct statements from your java Multiple Choice Questions. I'll use 50 of these and add 10 to 20 of my own, mainly from chapter 4 on methods. For example, method header parts, method signature, calling a method, overloading a method, etc. ==================================================================================== 1) Machine language is the language that can be directly used by the computer 2) Applets and applications are 2 types of java programs 3) System.out is the standard output stream object 4) An expression is any valid combination of operators and operands 5) 3 primitive data types are: int, boolean, char 6) 3 class types are: Math,Applet,Polygon 7) 2 wrapper classes are: Character, Byte 8) 2 methods from Applet class are: init,paint 9) java is an interpreter 10) The DOS command javac Heart.java will compile the file Heart.java 1) 10*2%2+24/3-1 has value 7 2. Method paint enables the applet to display information and can be invoked again 4. All java objects are passed to methods by reference: address passed 5. An array element is always specified by using a subscript 7. The switch statement needs break statement to exit the structure early 10. boolean is a primitive data type 12. The statement c=new int[12]; allocates an array 1) String is not a primitive data type 2) javac produces a file with extension .class 3) The difference between an applet and an application is: One runs in a browser and the other from the operating system. 4) By custom or style, you use first letter uppercase for a class type 5) g.drawRect( 20, 30, 100, 70); Displays a rect with: upper left corner at y=30, x=20, and width=100, height=70 6) The statement g.fillRect( 60, 100, 45, 80); fills a Rectangle 7) The value of 20%3 is 2 8) The if/else control statement is a selection structure 10) The expression (((3*(5+3)-4)/5) has value 4 1. Method actionPerformed() must be defined if a class implements ActionListener 3. Method init() is called once in an applet 4. This for loop will repeat itself 50 times for(i=50; i>0; i--) 5. An applet needs a browser to run it, an application runs from the operating system 6.The keyword new is used to instantiate a variable 7. Expression (int)9/5 has value 1 8. Expression (double)9.0/5.0 has value 1.8 9.Expression 9%5 has value 4 10. The type of sound files that can java play is .au Q1. The if statement is a selection structure Q2. The if statement is a single selection statement Q3. The while statement is not a selection structure Q4.The statement showStatus( "" ); clears the status bar area Q5. The statement java Filename executes the Filename.class file Q6.The method public void init() is used to setup GUI components and instantiate variables in a java program Q7. The statement Label prompt1 ; creates a prompt for an input value Q8.Every Java statement must end with a semicolon (;) Q9. All java applets must inherit from the Applet class Q10. A line that begins with // is never executed 1. The value assigned to int x by the following statement x = (int) ((8.1 + 6.6) * 2); is 29 2. An object is always an instance of a class 3. The use of [ ] denotes an array 4. An example of a ternary expression is (6 < 8 ? 48 : 14) 5. The statement y = (int) (Math.random( ) * 1000); results in a y value in the range: 0 to 999 6. if / else and switch statements are examples of Selection Structure 7. In the statement g.drawArc ( 150, 20, 30, 40, 0, 90 ); the 30 and 40 represent the width and height of bounding box for arc 8. Primitive data types double, boolean have the largest, smallest number of possible values 9. 1 is the subscript for value 3 in the following array: int n [ ] = {1, 3, 2, 4, 9, 8, 7, 5, 6, 0}; 10. The following expression with relational and logical operators (marblesFloor = = 210) || (catsEyes != 300) is read as: marblesFloor is equal to 210 or catsEyes does not equal 300 1. The following statement will create an object String str = new String( ); 1. The following statement is not a rule of operator precedence: Operators are applied from right to left if an expression contains several multiplications. 2. The Graphics class in Java programs enables the program to draw graphics such as lines, rectangles, and ovals. 3. The appletviewer requires an HTML to load an applet 4. x =+ 1; is not a valid Java statement for adding 1 to integer variable x 5.The correct output from the following java code is 1: x = 1; while (x == 5) { x = x + 1; x = 0; } System.out.println("the output is" + x); 6. The key word switch is not a Java repetition structure 7. All programs can be written in terms of three types of control structures, but increment is not one of them. 9. The following is NOT part of the correct truth table for the logical AND operator, &&: false AND false has value true 10. The data type String is not a primitive data type 1) showStatus ("This is a test"); would not be found in a Java Application 2. In the statement, value = (int) (Math.random() * 6); a number in range 0 through 5 could be assigned to value. 3. boolean is a primitive data type and Boolean is a wrapper class 3. The following statement correctly creates an int array and initializes its values; int n[] = {19,3,15,7}; 4. ActionListener is an interface 5. The value of a double called x in the following statement: x = 5 + 11 / 3; is 8 6. In the statement g.drawString ("This is a Test", 15, 25) the string is drawn beginning at the 15th pixel over and the 25th pixel down 7. The switch statement is a Java control structure that supports selection or branching 8. The cast operator creates a temporary storage of the specified type for its operand 10. The following statement will place the numbers 1 through 50 in the status bar for (int n = 1; n <=50; n++) showStatus(n);