Instruction
- Total number of questions : 10.
- Time alloted : 10 minutes.
- Each question carry 1 mark.
- No Negative marks
- DO NOT refresh the page.
- All the best :-).
1. |
Which of these operators can be used to concatenate two or more String objects? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: operator + is used to concatenate strings, Example String s = “i ” + “like ” + “java”; String s contains “I like java” |
2. |
Which of these methods is an alternative to getChars() that stores the characters in an array of bytes? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: getBytes() stores the character in an array of bytes. It uses default character to byte conversions provided by platform. |
3. |
What will s2 contain after following lines of code? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Two strings can be concatenated by using concat() method. |
4. |
Which of these method of class StringBuffer is used to concatenate the string representation to the end of invoking string? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: None. |
5. |
What will s2 contain after following lines of code? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Two strings can be concatenated by using append() method. |
6. |
Which of these methods is used to compare a specific region inside a string with another specific region in another string? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: None. |
7. |
Which of these is a mechanism for naming and visibility control of a class and its content? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: Packages are both naming and visibility control mechanism. We can define a class inside a package which is not accessible by code outside the package. |
8. |
Which of these can be used to fully abstract a class from its implementation? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: None. |
9. |
Which of these is a process of converting a simple data type into a class? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: None. |
10. |
Which of the following methods is a method of wrapper Integer for obtaining hash code for the invoking object? |
|||||||||||||||||||
|