homework and midterm

Println statement 22 assume the following code is

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 0 × 128 = 0 × 64 = 0 × 32 = 0 × 16 = 1 × 8 = 1 × 4 = 1 × 2 = 1× 1 = (00001111)2 = (15)10 0 0 0 0 8 4 2 1 +_____ 15 3 21. What is wrong with the following program? You may notate the code itself and/or write below the code. public class void Main{ public static void MyMethod{ system.out.println(“Hello world!”) } } The indentation is incorrect There is a void is in the class declaration The program has no main method (or MyMethod missing () ) The S is not capitalized in system.out.println There is no semicolon after the System.out.println statement 22. Assume the following code is contained in a method. What is wrong with the following code? Please write below the code. Float my@float; /* placeholder for data final Int 25TH_PERCENTILE = 5; Float should not be capitalized my@float not initialized; @ is an illegal character in a variable name The comment block is not closed Int should not be capitalized Identifiers cannot start with a number 4 23. Write the output of the following program in the space provided below: public class Loo...
View Full Document

Ask a homework question - tutors are online