Web Services Development MCQs with Answers
Practice important Web Services Development MCQs with answers and explanations.
Multiple Choice Questions
Q201: How can a primitive data type be passed by reference in Java?
- A: Using the 'final' keyword
- B: Wrapping it in an object
- C: Passing it as an array
- D: Using the 'static' keyword
View Answer
C
Q202: What is the result of the following code execution: int[] myInt = { 1 }; increment(myInt, 5); System.out.println("Array contents : " + myInt[0]);
- A: Array contents: 6
- B: Array contents: 1
- C: Array contents: 5
- D: Array contents: 7
View Answer
A
Q203: Which method is called when Java program execution begins?
- A: main()
- B: start()
- C: init()
- D: run()
View Answer
A
Q204: What is a formal parameter in a method?
- A: The actual value passed into the method
- B: The identifier used to stand for the value passed
- C: The method's return type
- D: A variable in a class
View Answer
B
Q205: What is an actual parameter in a method?
- A: The method's return type
- B: The identifier used to stand for the value passed
- C: The actual value passed into the method
- D: The method name
View Answer
C
Q206: Which keyword is used to refer to the current class instance variable?
- A: super
- B: this
- C: static
- D: final
View Answer
B
Q207: Which keyword can be used to invoke the current class constructor?
- A: super
- B: this
- C: static
- D: final
View Answer
B
Q208: What does a static method in a class not have access to?
- A: Static methods
- B: Static data
- C: Instance methods
- D: Instance variables
View Answer
D
Q209: How can static methods and variables be accessed?
- A: By creating an instance of the class
- B: Using the class name
- C: By passing them as arguments
- D: By returning them from a method
View Answer
B
Q210: Which of the following is NOT true about static variables?
- A: They are shared among all instances of the class
- B: They are initialized when the class is loaded
- C: They are initialized with default values when the class is loaded
- D: They are specific to each instance of the class
View Answer
D