MCQOPTIONS
Saved Bookmarks
This section includes 9 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Whenever a subclass needs to refer to its immediate superclass, it can do so by use of the keyword super. |
| A. | Yes |
| B. | No |
| C. | Can be yes or no |
| D. | Can not say |
| E. | |
| Answer» B. No | |
| 2. |
Which of the following is true about boolean equals(Object anObject)? |
| A. | Tests if this string ends with the specified suffix |
| B. | Compares this string to the specified object |
| C. | Compares this String to another String, ignoring case considerations |
| D. | None of the above |
| Answer» C. Compares this String to another String, ignoring case considerations | |
| 3. |
Which method returns a String that represents the character sequence in the array specified? |
| A. | int compareToIgnoreCase(String str) |
| B. | String concat(String str) |
| C. | boolean contentEquals(StringBuffer sb) |
| D. | static String copyValueOf(char[] data) |
| Answer» D. static String copyValueOf(char[] data) | |
| 4. |
Which method returns the character at the specified index? |
| A. | int compareTo(Object o) |
| B. | int compareTo(String anotherString) |
| C. | char charAt(int index) |
| D. | int compareToIgnoreCase(String str) |
| Answer» D. int compareToIgnoreCase(String str) | |
| 5. |
Which methods to print output with formatted numbers? |
| A. | printf() |
| B. | format() |
| C. | formatted() |
| D. | Both A and B |
| Answer» E. | |
| 6. |
Methods used to obtain information about an object are known as? |
| A. | string methods |
| B. | class methods |
| C. | object method |
| D. | accessor methods |
| Answer» E. | |
| 7. |
The String class is? |
| A. | mutable |
| B. | immutable |
| C. | Both A and B |
| D. | None of the above |
| Answer» C. Both A and B | |
| 8. |
In Java programming language, strings are treated as objects. |
| A. | TRUE |
| B. | FALSE |
| C. | Can be true or false |
| D. | Can not say |
| Answer» B. FALSE | |
| 9. |
_________ are a sequence of characters. |
| A. | Character |
| B. | Strings |
| C. | Integer |
| D. | Classes |
| Answer» C. Integer | |