Web Services Development MCQs with Answers
Practice important Web Services Development MCQs with answers and explanations.
Multiple Choice Questions
Q91: The method System.out.println is used to ___.
- A: declare variables
- B: print strings to the console
- C: end the program
- D: handle exceptions
View Answer
B
Q92: Sentinel controlled loops are terminated based on ___.
- A: a fixed number of iterations
- B: the value of a sentinel variable
- C: user input
- D: the number of loop executions
View Answer
B
Q93: In the example provided, the sentinel variable is ___.
- A: while
- B: num
- C: printf
- D: scanf
View Answer
B
Q94: In Java, the keyword 'static' means ___.
- A: a method is accessible without any objects of the class
- B: a method returns a value
- C: a method can only be called within its class
- D: a method can be overloaded
View Answer
A
Q95: The package statement in Java defines ___.
- A: a new class
- B: a name space for classes
- C: a method
- D: a variable
View Answer
B
Q96: Block comments in Java are enclosed with ___.
- A: /* and */
- B: // and //
- C: { and }
- D: ""
View Answer
A
Q97: The condition in a while loop is evaluated ____.
- A: after each iteration
- B: before each iteration
- C: only once
- D: at random
View Answer
B
Q98: The following is an example of a ____ loop: do { statement } while (condition);
- A: for
- B: sentinel controlled
- C: do-while
- D: if-then
View Answer
C
Q99: Java uses __ to declare a class.
- A: method
- B: public
- C: package
- D: class
View Answer
D
Q100: The access modifier keyword in Java that makes a class accessible to all is ___.
- A: private
- B: public
- C: protected
- D: static
View Answer
B