FREE Sun Certified Java Programmer Questions and Answers

0%

Which of the following accurately describes the main() method of an application?

Correct! Wrong!

Both of these definitions are acceptable, and the choice between them depends on your personal preference or the coding standards of the project you are working on.

What identifiers are valid?

Correct! Wrong!

"_xpoints", "r2d2", and "bBb$" - are valid in Java.
Java allows a combination of letters (both uppercase and lowercase), digits, and underscores to form valid identifiers. However, an identifier must begin with a letter (uppercase or lowercase), underscore, or a currency character (such as '$'). It cannot start with a digit.

Which of the following is true:

Correct! Wrong!

>> performs signed shift while >>> performs an unsigned shift are accurate.

Which of the following statements about a two-dimensional array of numbers is legal?

Correct! Wrong!

Which declarations would be acceptable if we wanted to represent the snowfall in Gnome, Alaska, for each day of March as an array of 31 floating point numbers?

Please select 2 correct answers

Correct! Wrong!

Both declarations double snow[] = new double[31]; and double[] snow = new double[31]; are valid and would create an array of 31 floating-point numbers representing snowfall for each day of March in Gnome, Alaska.

The String variable s has "Hello Java" assigned to it in which of the following statements?

Please select 2 correct answers

Correct! Wrong!

Both statements String s = "Hello Java"; and String s = new String("Hello Java"); assign the string value "Hello Java" to the String variable s.

Which of the following are keywords used in Java?

Please select 2 correct answers

Correct! Wrong!

Both keywords are an integral part of the Java programming language and have specific meanings and functionalities within the language

Premium Tests $49/mo
FREE November-2024