Web Services Development MCQs with Answers
Practice important Web Services Development MCQs with answers and explanations.
Multiple Choice Questions
Q61: What is the output of the following code? int i = 4; double d = i; System.out.println(d);
- A: 4
- B: 4
- C: 4
- D: 4
View Answer
B
Q62: In down-casting, why is explicit casting required?
- A: To prevent information loss
- B: Because the compiler automatically handles it
- C: To convert from smaller datatype to larger datatype
- D: To ensure safe conversion
View Answer
A
Q63: Which of the following describes the process of down-casting?
- A: Converting a larger datatype to a smaller datatype
- B: Converting a smaller datatype to a larger datatype
- C: Implicit conversion
- D: Automatic conversion
View Answer
A
Q64: In the example provided, how can the FillCircle method be called after down-casting?
- A: ((Circle)s).FillCircle()
- B: s.FillCircle();
- C: s.Draw();
- D: s.Fill();
View Answer
A
Q65: Why is down-casting considered potentially unsafe?
- A: It can lead to runtime errors
- B: It always succeeds
- C: It is handled by the compiler
- D: It doesn't require explicit casting
View Answer
A
Q66: How many types of variables are there in Java?
- A: Two
- B: Three
- C: Four
- D: Five
View Answer
B
Q67: Local variables are declared in __________.
- A: classes
- B: constructors
- C: methods, constructors, or blocks
- D: objects
View Answer
C
Q68: Instance variables are created when __________.
- A: the class is declared
- B: the object is created
- C: the method is called
- D: the block is initialized
View Answer
B
Q69: Which type of variable is declared with the keyword 'static'?
- A: Instance variable
- B: Local variable
- C: Class variable
- D: Method variable
View Answer
C
Q70: Which variables have only one copy per class?
- A: Instance variables
- B: Local variables
- C: Class variables
- D: Method variables
View Answer
C