GSEB-XII: COMPUTER STUDIES : Ch-9 : Working with Array and Strings (Ref. to Guide)
1)
An …………. Is a variable representing a
collection of homogeneous type of elements.
(a)
arrangement
(b)
array
(c)
assortment
(d)
group
2)
………….. are useful to represent vector,
matrix and other multi-dimensional data.
(a)
Arrangements
(b)
Arrays
(c)
Assortments
(d)
Groups
3)
………. Is one dimensional (1-D) data
structure that can be used to store list of items like characters, numbers.
(a)
Vector
(b)
Path
(c)
Matrix
(d)
Route
4)
…………. Is used to represent two
dimensional (2-D) data structure like table or rows and columns.
(a)
Vector
(b)
Path
(c)
Matrix
(d)
Route
5)
…………. are useful when same operations are
to be performed on various elements of the similar type.
(a)
Matrix’s
(b)
Arrays
(c)
Dimensions
(d)
Groups
6)
All the…………. of an array are stored in
memory using contiguous storage space.
(a)
index’s
(b)
values
(c)
features
(d)
elements
7)
Each element is identified by an……….
Position associated with array variable .
(a)
index
(b)
value
(c)
tabular
(d)
element
8)
In Java, …………… is an object used to
manage list of items.
(a)
array
(b)
variable
(c)
matrix
(d)
element
9)
Creating an array is a…….. step process.
(a)
one
(b)
two
(c)
three
(d)
four
10)
An array object can be created in………..
ways.
(a)
one
(b)
two
(c)
three
(d)
four
11)
Which is the way an array object can be
created ?
(a)
Using new operator and specifying the
size.
(b)
Directly initializing the content of
array
(c)
Both (a) and (b)
(d)
None of these
12)
Array with……… dimension is known as 1-D
array.
(a)
double
(b)
triple
(c)
both (a) and (b)
(d)
single
13)
For example,……… can be seen as a
collection of one or more scalar variables.
(a)
vector
(b)
path
(c)
matrix
(d)
variable
14)
Instead of declaring individual variables
like marks 1, marks2, marks3, marks4, marks5; one can declare array……….. .
(a)
Marks[5]
(b)
Mark[5]
(c)
Marks[1-5]
(d)
All of these
15)
Individual variable elements of an array
marks[5] can be accessed as:
(a)
marks [1], marks[2], marks[3], marks[4], marks[5]
(b)
marks [-1], marks[1], marks[2], marks[3],
marks[4]
(c)
marks [0], marks[1],
marks[2], marks[3], marks[4]
(d)
marks [-1], marks[0], marks[1], marks[2],
marks[3]
16)
To declare a ……….. array a pair of square
brackets [ ] is used after array name or after data type.
(a)
2-D
(b)
1-D
(c)
3-D
(d)
4-D
17)
The syntax to declare array is as follows……… .
(a)
< data type><array name> [ ];
(b)
< data type> [ ] < array
name>;
(c)
both (a) and (b)
(d)
none of these
18)
For example, to store the marks obtained
by a student in five tests in mathematics subject, an array of ………. Integer
elements can be used,
(a)
five
(b)
six
(c)
four
(d)
seven
19)
Array object named ‘marks’ with size for
5 elements can be created as follows:
(a)
int marks [ ] = new int [5];
(b)
int [ ] marks = new int [ 5];
(c)
both (a) and (b)
(d)
none of these
20)
The array ‘marks’ refers to…….. location where
five integer values are stored.
(a)
chip
(b)
memory
(c)
variable
(d)
address
21)
integer of int data type uses ……….. bytes
storage space.
(a)
2
(b)
3
(c)
4
(d)
5
22)
Thus array ‘marks’ requires …….. bytes in
contiguous locations in memory.
(a)
5 x 4 =20
(b)
5 x 5 =25
(c)
5 x 3 =15
(d)
5 x 2 = 10
23)
To refer an element of an array, an index
or subscript is used in…….. after array variable name.
(a)
curly bracket { }
(b)
square bracket [ ]
(c)
round bracket ( )
(d)
none of these
24)
………… specifies the position of an element
in an array.
(a)
Number
(b)
Index
(c)
Variable name
(d)
Element
25)
Index value starts from ………… .
(a)
5
(b)
4
(c)
1
(d)
0
26)
The array variable marks [5] has an index
value from……… .
(a)
1 to 5
(b)
0 to 4
(c)
0 to 5
(d)
1 to 4
27)
In array variable marks [5], marks [0]
refers to the ……. Element.
(a)
last
(b)
second
(c)
first
(d)
none of these
28)
In array variable marks [5], marks [4]
refers to the……….. element.
(a)
last
(b)
second
(c)
first
(d)
fourth
29)
An object is a……. to variable.
(a)
position
(b)
location
(c)
address
(d)
reference
30)
Array being an object in java, array name
is also a……… variable.
(a)
position
(b)
location
(c)
address
(d)
reference
31)
Array
name contains……… to memory location where the array elements are stored.
(a)
position
(b)
location
(c)
address
(d)
reference
32)
As array is an object, so its elements
are initialized with………. Values.
(a)
default
(b)
initial
(c)
declared
(d)
index
33)
1-D
array is initialized using……. separated values of data elements in
braces { }.
(a)
semi colon
(b)
comma
(c)
colon
(d)
full stop
34)
Which of the following is correct
initialization of 1-D array ?
(a)
int marks [ ] = { 90, 70, 77};
(b)
int [ ] marks = { 90,70,77};
(c)
int marks [ ] = { 90, 70; 77}
(d)
both (a) and (b)
35)
When an array is initialized while
creating, it does not need the use of………… operator.
(a)
New
(b)
new
(c)
int
(d)
float
36)
The array size is same as the number of
values specific in………..
(a)
braces
(b)
index
(c)
default value
(d)
initialization
37)
Class methods are declared as……….. and can be referred
without any object in a class.
(a)
private
(b)
void
(c)
package
(d) Static
38)
Every element of an array is an
individual variable that can be referred by using.
(a) index
(b)
value
(c)
tabular
(d)
element
39)
Like variables, to change the value of an
element, an assignment statement can be used which refers a variables element
on……….. side.
(a)
right
(b) left
(c)
middle
(d)
none of these
40)
Instead of writing the code, various
static methods provided by java using……… class can be used.
(a)
java.
Arrays
(b)
java. utility
(c) java.util.Arrays
(d)
All of these
41)
Methods sort() and fill () are part of…….
Class.
(a)
java. Arrays
(b)
java.util
(c) java.util.Arrays
(d)
all of these
42)
To sort an entire or part of array, ……..
method can be used.
(a) sort( )
(b)
file( )
(c)
display ( )
(d)
order ( )
43)
Method ……….. is used to fill or partial
array with specified value.
(a)
sort( )
(b) fill ( )
(c)
display ( )
(d)
order ( )
44)
To search an element in an array, arrays
class provides………… method.
(a)
search ( )
(b)
find ()
(c) binary search ( )
(d)
bin search ( )
45)
………… search method does element bye
element comparison in a serial manner.
(a) Linear
(b)
Vertical
(c)
Horizontal
(d)
Vector
46)
……………. Arrays are used to store tabular
data in the form of rows and columns.
(a) 2-D
(b)
1-D
(c)
3-D
(d)
4-D
47)
In java, 2-D array can be declared using
array name and 2 pairs of……… to specify the size of two dimensions row and
column respectively.
(a)
Curly bracket { } { }
(b) Square bracket [ ] []
(c)
Round bracket ( ) ( )
(d)
None of these
48)
Int marks [ ] [ ] = new int [ 5 ] [ 3 ] ,
the logical view of array elements is a table of ……… (a) 3 rows and 5 columns
(b) 15 columns
(c) 5
row and 3 columns
(d) 15 rows
49)
Int marks [ ]
[ ] = new int [5] [3], the logical view of array elements is a table of………
(a)
15
(b)
45
(c) 60
(d)
8
50)
To create …………. Array, and array of an
array has be created.
(a) 2-D
(b)
1-D
(c)
3-d
(d)
4-D
51)
Declaration and initialization of 2-D
array is very similar to 1-D array except the number of ……..
(a)
sizes
(b)
length
(c)
index values
(d) dimensions
52)
In 2-D array, each row is considered as….. array element.
(a)
2-D
(b) 1-D
(c)
3-D
(d)
4-D
53)
To initialize 2-D array, all these initialized
rows are to be enclosed in curly braces { } separating them by…. .
(a)
Colon
( : )
(b) Comma (,)
(c)
Semi colon (;)
(d)
Full stop (.)
54)
In java, 2-D array is considered as an………
of 1-D array.
(a)
matrix
(b) array
(c)
dimension
(d)
group
55)
In 2-D array, each name is stored in different
row and all names have different number of………
(a)
spaces
(b)
groups
(c) characters
(d)
columns
56)
Size of each row of an array can be known
using……… property of 1-D array.
(a) length
(b)
height
(c)
len
(d)
size
57)
For 2-D array, …………… property returns
number of rows.
(a) length
(b)
height
(c)
len
(d)
size
58)
for 1-D array, ………. Property returns
number of columns in specified row elements.
(a) Le ngth
(b)
height
(c)
len
(d)
size
59)
…………is a collection of homogeneous type
of data.
(a)
Matrix
(b) Array
(c)
Dimension
(d)
Group
60)
………… elements can be accessed using index
for each dimension in [ ].
(a)
Matrix
(b) Array
(c)
Dimension
(d)
Group
61)
Index value starts with……… .
(a)
one
(b)
two
(c) zero
(d)
three
62)
Declaring an………… without initialization
does not create an array object.
(a)
matrix
(b) array
(c)
dimension
(d)
group
63)
String is nothing but a sequence of…………
(a)
spaces
(b)
groups
(c) characters
(d)
columns
64)
1-D array of……….. can be considered as a
string.
(a)
spaces
(b)
groups
(c) characters
(d)
columns
65)
………….. literals are where a sequence of
characters is enclosed between double quotes.
(a) String
(b)
Character
(c)
Numerical
(d)
None of these
66)
To use variables that can store strings,
java supports………. Types of strings.
(a) one
(b)two
(c) three
(d)four
67)
Strings in java are handled by two
classes namely ‘String’ and……….. .
(a)
Strings
(b)
Characters
(c)
Buffer
(d) String Buffer
68)
String ( ) without arguments create a……….
object with no character.
(a) string
(b)
character
(c)
buffer
(d)
code
69)
String ( char ary[ ]) creates a String
object with its initial value using ary……. .
(a)
value
(b) argument
(c)
Index
(d)
[ ]
70)
String (char ary [ ], int start, intlen)
creates a String object using 1-D ary argument starting at ary [start] with
…….. number of characters/
(a)
length
(b)
length
(c) len
(d)
limited
71)
String ( Sting strObj) creates a String
object which is same as object specified in…….. .
(a)
value
(b) argument
(c)
index
(d)
square brackets [ ]
72)
String (string literal ) creates a
string…………… which is same as object specified in argument.
(a)
literal
(b)
obj
(c) object
(d)
variable
73)
String (string literal) creates a String
object that refers to the………. specified in argument.
(a) literal
(b)
obj
(c)
object
(d)
variable
74)
In java, characters are stored using………..
bytes.
(a)
four
(b)
three
(c) two
(d)
five
75)
To save space, if the characters are……..,
an array of bytes should used instead of array of characters.
(a) ASCII
(b)
coded
(c)
ACSII
(d)
ACIIS
76)
A………… can be used with array of bytes as
an argument.
(a)
method
(b)
destructor
(c)
variable
(d) constructor
77)
When two String objects are created using
same string literals, memory space is not allocated for …….. object.
(a)
first
(b) second
(c)
both (a) and (b)
(d)
none of these
78)
Separate memory is allocated when string
objects are created using…….. operator even if strings are identical.
(a)
New
(b) new
(c)
int
(d)
float
79)
“strl = = str2” …………. The contents of
str1 and str2 and not the objects at str1 and str2.
(a)
equals
(b)
matches
(c) compares
(d)
relates
80)
The String class provides……….. to compare
strings, find length of string, combining strings, obtaining substrings,
converting strings, splitting strings, searching for character or patterns in
string etc.
(a)
constructors
(b) methods.
(c)
strings
(d)
classes
81)
Method booleanequalsIgnore Case (String
str) returns ………….. if invoking string is same as str after ignoring case (case
insensitive).
(a) True
(b)
False
(c)
Can’t say
(d)
None of these
82)
Method booleanequalsIgnore Case (Strins
str) returns ……….. if invoking string is same as str after ignoring case (case
insentive) .
(a) True
(b)
False
(c)
Can’t say
(d)
None of these
83)
Method intcompareTo (String str) returns
0, > 0, <0………………if invoking string is equal to, greater than or less than
str respectively.
(a)
string
(b)
negative value
(c) integer
(d)
float
84)
Method intcompareTo Tolgnore Case (String
str) is same as…………but Case Sensitive.
(a)
Equals
(b)
Ignore Case
(c)
equalsIgnore Case
(d) compareTo
85)
A String class provides methods for……….
Task.
(a)
extracting part of string.
(b)
replacing characters or substrings.
(c)
splitting string into substrings
(d) all of these
86)
A String class provided methods for
………..task.
(a)
getting number of characters.
(b)
appending string
(c)
copy string or part of string
(d) all of these
87)
A string class provides methods for ………
task.
(a)
converting string into lowercase or
uppercase
(b)
appending string
(c)
copy string or part of string
(d) all of these
88)
Method int………. returns number of
characters in invoking string.
(a)
indexAt (int index)
(b) length ( )
(c)
getBytes( )
(d)
toUpperCAse( )
89)
Method char…………. Returns character at
index position from the invoking string, index considered from 0.
(a) indexAt (int index)
(b)
length( )
(c)
getBytes( )
(d)
toUpperCase( )
90)
Method char……….. returns character at
index position from the invoking string, index considered from 0.
(a)
IndexAt (int index)
(b)
length( )
(c) getBytes( )
(d)
toUpperCase( )
91)
Method void [ ]………… returns an array of
characters as bytes from invoking string.
(a)
to Uppar Case ()
(b)
to Lower Case
(c)
concat (String str)
(d) get Charts (intfromIndex, inttoIndex,
char target[], inttargetIndex).
92)
Method string…………. Returns a string after
appending str with the invoking string.
(a)
to UpperCase()
(b)
to Lower Case
(c) concat (String str)
(d)
get Charts (intfromIndex, inttoIndex,
char target[], inttargetIndex).
93)
String………. Returns a string with all
characters of invoking string converted to lowercase.
(a)
to UpperCase()
(b) to Lower Case
(c)
concat (String str)
(d)
get Charts (intfromIndex, inttoIndex,
char target[], inttargetIndex).
94)
String………. Returns a string with all
characters of invoking string converted to uppercase.
(a) to UpperCase()
(b)
to Lower Case
(c)
concat (String str)
(d)
get Charts (intfromIndex, inttoIndex,
char target[], inttargetIndex).
95)
With array variable, length is an……… or
property of array;
(a) attribute
(b)
method
(c)
string
(d)
none of these
96)
with String object length is a………. .
(a)
attribute
(b) method
(c)
string
(d)
none of these
97)
…………. Class of java does not provide any
method to reverse a string.
(a)
attribute
(b)
method
(c) string
(d)
none of these
98)
Java library also provides……….. class in
java.util package.
(a)
data
(b)
string
(c)
time
(d) date
99)
……… class encapsulates both data and time
and represents the value using milliseconds precision.
(a)
Data
(b)
String
(c)
Time
(d) Date
100)
Method ………. Constructs data object using
current system time.
(a)
Data (long elapsed Time)
(b) Data ()
(c)
toString()
(d)
getTime( )
101)
Method …………. Constructs data object using
specified time in milliseconds elapsed since January 1, 1970 GMT.
(a) Data (long elapsed Time)
(b)
Data ()
(c)
toString()
(d)
getTime( )
102)
Method String ……….. returns a string
representing data and time of invoking object.
(a)
Data (long elapsed Time)
(b)
Data ()
(c) toString()
(d)
getTime( )
103)
Method long………… returns number of
milliseconds since January 1, 1970 GMT.
(a)
Data (long elapsed Time)
(b)
Data ()
(c)
toString()
(d) getTime( )
104)
Method void set time (long elapsed Time )
sets new date and time of an object using elapsed time.
(a) setTime (long elapsed Time)
(b)
Date()
(c)
toString()
(d)
getTime()
105)
Like data class, …………. Class is also
provided in java.util package.
(a)
data
(b) calendar
(c)
time
(d)
date
106)
………….. class can be used be used to
extract calendar information like year, month , date, hour, minute and second.
(a)
data
(b) calendar
(c)
time
(d)
date
107)
Like get methods, set methods are used to set the value of
field constants of……… class.
(a)
data
(b) calendar
(c)
time
(a)
date
108)
Execution of call ‘calender.set
(Calender.DATE, 20)’ will set the date to……… .
(a)
Today’s date
(b)
Yesterday’s date
(c) 20th
(d)
None of these
109)
…………is the starting index of an array.
(a) 0
(b)
1
(c)
Null
(d)
All of these
110)
Array elements are stored in………
(a) sequential memory locations
(b)
scattered memory locations
(c)
direct memory locations
(d)
random memory locations
111)
Identify the incorrect declaration of
arrays from the following.
(a)
Int a[50];
(b)
Float values [10][20[;
(c)
Double a[50];
(d) Int score [10,15];
112)
Array is used to represent the following.
(a)
A list of data items of different data
types
(b)
A list of data items of real data type.
(c) A list of data items of same data type.
(d)
A list of data items of integer data
type.
113)
Array are passed to a function argument
by……………
(a) value
(b) reference
(c)
both value and reference
(d)
none
of these
114)
An array a[8] will store how many values
?
(a) 8
(b)
7
(c)
9
(d)
0
115)
If an array is declared as a a[10], then
its elements will be stored as……………..
(a)
a[1] to a[10]
(b) a[1] to a[9]
(c)
a[0] to a [9]
(d)
a[0] to a[10]
116)
The index or subscript value for an array
of size a ranges from
(a)
1 to n-1
(b) 0 to n-1
(c)
1 to n
(d)
0 to n
117)
If a static array is not initialized, the
elements will be set to…….. .
(a) 0
(b)
a float number
(c)
an undetermined value
(d)
a character constant
118)
If a static array is not initialized, the
elements will be set to……….
(a) 9
(b)
10
(c)
8
(d)
11
119)
If ‘a’ is the object of String class and
its content is “C IS A LANGUAGE”, then
what is the value of str.length() ?
(a)
14
(b) 15
(c)
12
(d)
11
120)
What type of value is returned when we
use get method of Calender class with constant MONTH ?
(a)
Char
(b)
String
(c) int
(d)
Boolean
121)
Method to string() returns ………… data
type.
(a)
Char
(b) String
(c)
int
(d)
Boolean
122)
Method getTime() returns ………. Data type.
(a) long
(b)
string
(c)
void
(d)
date
123)
Method concat (String str( returns ……….
Data types.
(a)
long
(b) string
(c)
void
(d)
date
124)
What is the full form of GMT ?
(a)
Greenwich Median Time
(b)
Greenwich Mode Time
(c)
Greenwich Modern Time
(d) Greenwich mean Time
No comments
Post your comments