4.24 Simple IO and Arrays and String Vectors
Exercise Questions
Objective Questions
1. Arrays are passé to methods as pass by reference only. TRUE/FALSE
2. Which of the following statements are true in respect of Java Strings?
(i)
Java String is an array of characters terminated by ‘\0’
(ii) Java String is an object of String class.
(iii) String is implemented using character array.
(iv) Java String is implemented using String class or
StringBuffer class.
(a) i and iii (b) ii and iii (c) ii and iv (d) iii and iv
3. A string in Java can be implemented by
(a)
String class (b) StringBuffer (c) StringBuilder (d) a, b and c
4. Which of the following are true in respect of Arrays and Strings?
(i)
arr.length() gives length of the array