Questions · Page 3 of 7

MCQ

MCQ 1011 Mark
When we declare an array variable without initialization, only a variable is created to hold the reference. Consider this statement.
  • This statement is true
  • B
    This statement is false
  • C
    It depends on version of Java
  • D
    It depends on type of an array
Answer
Correct option: A.
This statement is true
This statement is true
View full question & answer
MCQ 1021 Mark
In Java, what can we not specify at the same time while declaring an array?
  • The size of dimensions and initial values of the array elements.
  • B
    Initial values of an array and their type
  • C
    The size of dimensions and their type
  • D
    None of these
Answer
Correct option: A.
The size of dimensions and initial values of the array elements.
The size of dimensions and initial values of the array elements.
View full question & answer
MCQ 1031 Mark
How much size does it takes initially when an array is initialized while creating?
  • Same as the number of values specifies in braces.
  • B
    More than one as the number of values specifies in braces.
  • C
    Less than one as the number of values specifies in braces.
  • D
    None of these
Answer
Correct option: A.
Same as the number of values specifies in braces.
Same as the number of values specifies in braces.
View full question & answer
MCQ 1041 Mark
Which operator need not be used when an array is initialized while creating?
  • A
    New
  • new
  • C
    Array
  • D
    array
Answer
Correct option: B.
new
new
View full question & answer
MCQ 1051 Mark
Which statement is used to declare a 1-D array with three laments to specify the initial values of data elements with 90, 70, 77’?
  • A
    int marks [ ] = {90, 70, 77}
  • B
    int [ ] marks = {90, 70, 77)
  • a Or b
  • D
    None of these
Answer
Correct option: C.
a Or b
a Or b
View full question & answer
MCQ 1061 Mark
In Java, by using which of the following one are initial values of data elements separated?
  • ,
  • B
    ;
  • C
    .
  • D
    :
Answer
Correct option: A.
,
,
View full question & answer
MCQ 1071 Mark
By which of the following, a 1-D array can be initialized using comma separated values of data elements in Java?
  • A
    [ ]
  • { }
  • C
    ( )
  • D
    anyone
Answer
Correct option: B.
{ }
{ }
View full question & answer
MCQ 1081 Mark
What is an array, so that its elements are initialized?
  • Object
  • B
    Class
  • C
    Method
  • D
    None of these
Answer
Correct option: A.
Object
Object
View full question & answer
MCQ 1091 Mark
Which of the following is an array?
  • Object
  • B
    Class
  • C
    Method
  • D
    None of these
Answer
Correct option: A.
Object
Object
View full question & answer
MCQ 1101 Mark
Which of the following is a reference variable?
  • Object
  • B
    Method
  • C
    Array
  • D
    a and b both
Answer
Correct option: A.
Object
Object
View full question & answer
MCQ 1111 Mark
‘Which element does marks [4] specify if we declare an array marks [5]?
  • A
    Last
  • B
    Fourth
  • C
    Fifth
  • a or b
Answer
Correct option: D.
a or b
a or b
View full question & answer
MCQ 1121 Mark
Which of the following specify the first element of an array?
  • marks [0]
  • B
    marks [---1]
  • C
    marks [1]
  • D
    marks[N]
Answer
Correct option: A.
marks [0]
marks [0]
View full question & answer
MCQ 1131 Mark
If we declare marks [5] array than what will be the index value of marks array?
  • A
    1 to 5
  • 0 to 4
  • C
    O to 5
  • D
    1 to 4
Answer
Correct option: B.
0 to 4
0 to 4
View full question & answer
MCQ 1151 Mark
Whose position does index or subscript specify hi an array?
  • Element
  • B
    User
  • C
    Kernel
  • D
    Compiler
Answer
Correct option: A.
Element
Element
View full question & answer
MCQ 1161 Mark
What do we use to refer an element of an array in the square bracket [] after array variable name?
  • A
    Index
  • B
    Subscript
  • a Or b
  • D
    None of these
Answer
Correct option: C.
a Or b
a Or b
View full question & answer
MCQ 1171 Mark
How many bytes ‘mt1 data type requires to store integer values in contiguous locations in memory?
  • 20
  • B
    10
  • C
    5
  • D
    15
Answer
Correct option: A.
20
20
View full question & answer
MCQ 1191 Mark
How can an array object named ‘marks’ with the size for 5 elements be created?
  • A
    int marks [ ] = new int [5];
  • B
    int [ ] marks = new int [5];
  • a Or b
  • D
    None of these
Answer
Correct option: C.
a Or b
a Or b
View full question & answer
MCQ 1201 Mark
Which of the following is a statement to declare an array?
  • A
    [ ];
  • B
    [ ] ;
  • a Or b
  • D
    None of these
Answer
Correct option: C.
a Or b
a Or b
View full question & answer
MCQ 1211 Mark
What follows a pair of square brackets to declare a 1-D array?
  • A
    Array name
  • B
    Data type
  • a and b both
  • D
    None of these
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 1221 Mark
Which of the following can be seen as a collection of one or more scalar variables?
  • Vector
  • B
    Matrix
  • C
    Pixel
  • D
    Map
Answer
Correct option: A.
Vector
Vector
View full question & answer
MCQ 1231 Mark
How can an array object be created?
  • A
    Using ‘new” operator and specifying the size
  • B
    Directly initializing the content of an array
  • a and b both
  • D
    None of these
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 1241 Mark
What process is to be done to create an array?
  • A
    Declare an array object
  • B
    Create an array object
  • a and b both
  • D
    None of these
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 1251 Mark
In Java, which is the object used to manage list of items?
  • A
    String
  • Array
  • C
    Boolean
  • D
    Float
Answer
Correct option: B.
Array
Array
View full question & answer
MCQ 1261 Mark
What identifies each element associated with array variable?
  • Index position
  • B
    Index symbol
  • C
    Index name
  • D
    Any of these
Answer
Correct option: A.
Index position
Index position
View full question & answer
MCQ 1271 Mark
To which of the following are all the elements stored in memory using contiguous storage ‘space?
  • Array
  • B
    Integer
  • C
    String
  • D
    Literal
Answer
Correct option: A.
Array
Array
View full question & answer
MCQ 1281 Mark
In Java which kind of operations are arrays useful to perform on various elements of the similar type?
  • Same
  • B
    Different
  • C
    Integer
  • D
    Character
Answer
Correct option: A.
Same
Same
View full question & answer
MCQ 1291 Mark
Which of the following is used to represent two dimensional data structure like table of rows and columns?
  • A
    Vector
  • Matrix
  • C
    String
  • D
    Map
Answer
Correct option: B.
Matrix
Matrix
View full question & answer
MCQ 1301 Mark
Which of the following is one dimensional data structure that can be used to store list of items like characters and numbers?
  • Vector
  • B
    Matrix
  • C
    String
  • D
    Map
Answer
Correct option: A.
Vector
Vector
View full question & answer
MCQ 1311 Mark
Which of the following information can be represented using arrays?
  • A
    Vector
  • B
    Multi-dimensional
  • C
    Matrix
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 1321 Mark
Which of the following are useful to represent vector, matrix and other multi-dimensional data?
  • A
    String
  • Array
  • C
    Object
  • D
    Class
Answer
Correct option: B.
Array
Array
View full question & answer
MCQ 1331 Mark
Which of the following is a variable representing a collection of homogeneous type of elements?
  • A
    String
  • Array
  • C
    Object
  • D
    Class
Answer
Correct option: B.
Array
Array
View full question & answer
MCQ 1341 Mark
Which of the following is a composite data type?
  • A
    Array
  • B
    String
  • a and b both
  • D
    Character
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 1351 Mark
Which of the following data types can be used to store a collection of more than one data values?
  • Composite
  • B
    Basic
  • C
    Vector
  • D
    Primitive
Answer
Correct option: A.
Composite
Composite
View full question & answer
MCQ 1361 Mark
What are called basic variables also?
  • Scalar variable
  • B
    Vector variable
  • C
    Homogenous
  • D
    Joint or Composite
Answer
Correct option: A.
Scalar variable
Scalar variable
View full question & answer
MCQ 1371 Mark
Which kind of variable can store only one value at one time?
  • Basic
  • B
    Vector
  • C
    Homogenous
  • D
    All of these
Answer
Correct option: A.
Basic
Basic
View full question & answer
MCQ 1381 Mark
What type of value is returned when we use get method of Calendar class with constant DAY OF_WEEK as an argument?
  • int
  • B
    char
  • C
    String
  • D
    Boolean
Answer
Correct option: A.
int
int
View full question & answer
MCQ 1391 Mark
If ‘str’ is the object of String class and its content is “Thank GOD”, then what is the value of str. ienght0?
  • 9
  • B
    8
  • C
    11
  • D
    10
Answer
Correct option: A.
9
9
View full question & answer
MCQ 1401 Mark
What does ‘length’ refer to for an object of String class?
  • attribute
  • B
    method
  • C
    class variable
  • D
    class name
Answer
Correct option: A.
attribute
attribute
View full question & answer
MCQ 1411 Mark
When an array sale [5] [12] is declared without specifying initial values, what is the initial value of sales[O][O]?
  • 0
  • B
    default value
  • C
    compilation error
  • D
    60
Answer
Correct option: A.
0
0
View full question & answer
MCQ 1421 Mark
What will expression sales. Length return for an array sales[5][12] ?
  • 5
  • B
    12
  • C
    60
  • D
    120
Answer
Correct option: A.
5
5
View full question & answer
MCQ 1441 Mark
Which of the following refer to the starting index value in arrays?
  • 0
  • B
    1
  • C
    -
  • D
    All of these
Answer
Correct option: A.
0
0
View full question & answer
MCQ 1451 Mark
What is the meaning of length for array variable ?
  • A
    Method 
  • B
    Attribute 
  • C
    Properties 
  • (B) or (C)
Answer
Correct option: D.
(B) or (C)
(D) (B) or (C)
View full question & answer
MCQ 1461 Mark
………….. method return the number of characters lying in the string object.
  • A
    int len()
  • int length
  • C
    int count() 
  • D
    int encount()
Answer
Correct option: B.
int length
(B) int length
View full question & answer
MCQ 1471 Mark
If the string and parameter str(object) are same then ……….. value is returned.
  • True 
  • B
    False 
  • C
    Wrong 
  • D
    Error
Answer
Correct option: A.
True 
(A) True
View full question & answer
MCQ 1481 Mark
If two strings are same the using …………… operator different locations are assigned in the memory.
  • A
    create 
  • new 
  • C
    CREATE 
  • D
    Set
Answer
Correct option: B.
new 
(B) new
View full question & answer
MCQ 1491 Mark
Method getTime() returns ……………. data type.
  • long 
  • B
    String 
  • C
    void 
  • D
    Date
Answer
Correct option: A.
long 
(A) long
View full question & answer
MCQ 1501 Mark
1-D array of ………….. can be considered as a string.
  • spaces 
  • B
    groups 
  • C
    characters 
  • D
    columns
Answer
Correct option: A.
spaces 
(A) spaces
View full question & answer