click below
click below
Normal Size Small Size show me how
LHS_COMPSCI
| Question | Answer |
|---|---|
| Which of the following lines correctly defines an integer variable | int b=234; |
| Which of the following lines correctly defines a String variable | String word1="Hello"; |
| Which of the following methods would move the cursor down to the next line | println() |
| Which of the following types uses the least memory | char |
| Which of the following types uses the most memory | float |
| Which of the following would print one backslash on the screen is used in a print() or println() | \\ |
| What is output by the code below char x = 'A'; System.out.print(x+3); | 68 |
| What is output by the code below int x = 12; x = x-1; System.out.print(x): | 11 |
| What is output by the code below int x = 15; x = x%5; System.out.print(x); | 0 |
| What is output by the code below int x = 20; x = x*2; System.out.print(x); | 40 |