Questions · Page 2 of 7

MCQ

MCQ 511 Mark
In which of the following braces array elements can be accessed using index for each dimension?
  • [ ]
  • B
    {}
  • C
    <>
  • D
    ()
Answer
Correct option: A.
[ ]
[ ]
View full question & answer
MCQ 521 Mark
Which type of collection is an array?
  • Different
  • B
    Same
  • C
    Numeric
  • D
    Boolean
Answer
Correct option: A.
Different
Different
View full question & answer
MCQ 531 Mark
Using which of the following class of Java the 1-D array of characters can be defined?
  • string
  • B
    char
  • C
    str
  • D
    c
Answer
Correct option: A.
string
string
View full question & answer
MCQ 541 Mark
What does length property return when it is used with only array name?
  • Size of first dimension
  • B
    Multiplication of first and second dimensions
  • C
    Size of second dimension
  • D
    None of these
Answer
Correct option: A.
Size of first dimension
Size of first dimension
View full question & answer
MCQ 551 Mark
For 2-D array, number of elements is considered as number of rows and each row is a l-D array.” Specify this statement.
  • This statement is true.
  • B
    This statement is false.
  • C
    It depends on array.
  • D
    It depends on version of Java.
Answer
Correct option: A.
This statement is true.
This statement is true.
View full question & answer
MCQ 561 Mark
What does length property return for 1-D array?
  • Number of columns
  • B
    Number of rows
  • C
    Total number
  • D
    Total byte
Answer
Correct option: A.
Number of columns
Number of columns
View full question & answer
MCQ 571 Mark
What does the length property return for 2-D array?
  • Number of rows
  • B
    Number of columns
  • C
    Total number
  • D
    Total byte
Answer
Correct option: A.
Number of rows
Number of rows
View full question & answer
MCQ 581 Mark
Which property of 1-D array is used to know the size of each row?
  • length
  • B
    size
  • C
    Len
  • D
    size of
Answer
Correct option: A.
length
length
View full question & answer
MCQ 591 Mark
What is the value of nameslO,2] in char names [ ] [ ] = {{‘j’, ‘a’ , ‘v’, ‘a’), {‘c’}, {‘c’, ‘+‘, ‘+‘}} ?
  • A
    j
  • B
    a
  • v
  • D
    ava
Answer
Correct option: C.
v
v
View full question & answer
MCQ 601 Mark
What is the value of names[O] in char names [ ] [] = {{j , ‘v’, {c}, +}} ?
  • {‘j’, ‘a’, ‘v’, ‘a’}
  • B
    {‘c’}
  • C
    {‘c’, ‘+‘, ‘+‘}
  • D
    None of these
Answer
Correct option: A.
{‘j’, ‘a’, ‘v’, ‘a’}
{‘j’, ‘a’, ‘v’, ‘a’}
View full question & answer
MCQ 611 Mark
How many columns can have rows of 2-D array?
  • A
    1O
  • B
    5
  • C
    15
  • variable number of
Answer
Correct option: D.
variable number of
variable number of
View full question & answer
MCQ 621 Mark
Which array is known as an array of array in Java?
  • A
    1-D
  • 2-D
  • C
    a and b Both
  • D
    None of these
Answer
Correct option: B.
2-D
2-D
View full question & answer
MCQ 631 Mark
By Which of the following pair of braces each row is initialized by enclosing its elements separated by comma for 2-D array?
  • { }
  • B
    [ ]
  • C
    ( )
  • D
    ” “
Answer
Correct option: A.
{ }
{ }
View full question & answer
MCQ 641 Mark
What is to be considered as 1-D array element in 2-D array?
  • Row
  • B
    Columns
  • C
    a or b
  • D
    None of these
Answer
Correct option: A.
Row
Row
View full question & answer
MCQ 661 Mark
There is no limit on number of dimensions in Java.” Specify this statement.
  • This statement is true.
  • B
    This statement is false.
  • C
    It depends on data type.
  • D
    It depends on Java version.
Answer
Correct option: A.
This statement is true.
This statement is true.
View full question & answer
MCQ 671 Mark
Which of the following array can only be created by creating an array of array?
  • 2-D
  • B
    1-D
  • C
    0-D
  • D
    None of these
Answer
Correct option: A.
2-D
2-D
View full question & answer
MCQ 681 Mark
What does Java not support directly?
  • Multi-dimensional
  • B
    1-D
  • C
    0-D
  • D
    None of these
Answer
Correct option: A.
Multi-dimensional
Multi-dimensional
View full question & answer
MCQ 691 Mark
How many bytes of memory location are occupied by an array ‘m’ of int m [ ] [ ] =new int [5][31]?
  • A
    15
  • 60
  • C
    5
  • D
    3
Answer
Correct option: B.
60
60
View full question & answer
MCQ 701 Mark
What is the physical view of int m[ ] [ ]=new int[5] [3]?
  • Contiguous memory locations for 15 integers
  • B
    Table
  • C
    Contiguous memory locations for 5 integers
  • D
    None of these
Answer
Correct option: A.
Contiguous memory locations for 15 integers
Contiguous memory locations for 15 integers
View full question & answer
MCQ 711 Mark
What is the logical view of int m[ ] [] = new int 151 [31?
  • Table with 5 rows and 3 columns
  • B
    5 integer values
  • C
    15 integer values
  • D
    Table with 5 columns and 3 rows
Answer
Correct option: A.
Table with 5 rows and 3 columns
Table with 5 rows and 3 columns
View full question & answer
MCQ 721 Mark
Which of the following is a statement to declare an array named ‘m’ to store integer values in 5 rows and 3 columns?
  • A
    int m ( ) ( ) = new int [5][3];
  • int m [ ] [ ] =new int [5][3];
  • C
    int m [ ] [ ] =new int [3][5];
  • D
    None of these
Answer
Correct option: B.
int m [ ] [ ] =new int [5][3];
int m [ ] [ ] =new int [5][3];
View full question & answer
MCQ 731 Mark
What does a pair of square brackets specify which is used to declare 2-D array in Java?
  • Rows and columns
  • B
    Columns and rows
  • C
    Columns and columns
  • D
    Rows and rows
Answer
Correct option: A.
Rows and columns
Rows and columns
View full question & answer
MCQ 741 Mark
How many pairs of square brackets are used to declare 2-D array in Java?
  • A
    Three
  • Two
  • C
    Four
  • D
    One
Answer
Correct option: B.
Two
Two
View full question & answer
MCQ 751 Mark
Which of the following tabular arrangement is used to store 5 students’ marks in 3 tests?
  • 5 rows and 3 columns
  • B
    3 rows and 5 columns
  • C
    4 rows and 3 columns
  • D
    4 rows and 2 columns
Answer
Correct option: A.
5 rows and 3 columns
5 rows and 3 columns
View full question & answer
MCQ 761 Mark
Which of the following arrays is used to store tabular data in the form of rows and columns?
  • A
    3-D
  • 2-D
  • C
    1-D
  • D
    Mullti
Answer
Correct option: B.
2-D
2-D
View full question & answer
MCQ 771 Mark
Which of the following search method compares element by element in a serial fashion?
  • Linear
  • B
    Binary
  • C
    Random
  • D
    None of these
Answer
Correct option: A.
Linear
Linear
View full question & answer
MCQ 781 Mark
Which method is available in array class to search an element of given value?
  • A
    search ()
  • B
    find ()
  • binary search ()
  • D
    binary ()
Answer
Correct option: C.
binary search ()
binary search ()
View full question & answer
MCQ 791 Mark
To which of the following elements, value 5 is assigned by fill (list, 2, 6, 5) method?
  • A
    list [2] to list [6]
  • B
    list [2] and list [6]
  • list [2] to list [6-1]
  • D
    list [51 and list [6j
Answer
Correct option: C.
list [2] to list [6-1]
list [2] to list [6-1]
View full question & answer
MCQ 801 Mark
Which statement is used to assign value 7 to all elements of list array?
  • fill(list, 7)
  • B
    fill (7, list)
  • C
    fill (list. 7)
  • D
    fill(7. list)
Answer
Correct option: A.
fill(list, 7)
fill(list, 7)
View full question & answer
MCQ 811 Mark
Which arguments are given in fill method to fill partial array from element at start to (last-i) with the specified value?
  • Array, start, last, value
  • B
    Array, value, start, last
  • C
    Array, value, last, start
  • D
    Start, last, value, array
Answer
Correct option: A.
Array, start, last, value
Array, start, last, value
View full question & answer
MCQ 821 Mark
What does the fill method assign to all array elements when the method is invoked with two arguments namely array and value?
  • A
    1
  • B
    0
  • C
    -
  • Specified value
Answer
Correct option: D.
Specified value
Specified value
View full question & answer
MCQ 831 Mark
How to invoke fil0 method?
  • A
    With two arguments
  • B
    With four arguments
  • 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 851 Mark
Which method is used to fill the whole or partial array with the specified value?
  • A
    impolite ()
  • fill ()
  • C
    value ()
  • D
    None of these
Answer
Correct option: B.
fill ()
fill ()
View full question & answer
MCQ 861 Mark
Which elements can be sorted by java.util.Arrays.sort(list,1,5)?
  • list [1] to list [5-1]
  • B
    list [1] to list [5]
  • C
    list [O] to list [5]
  • D
    list [O] to list [5-1]
Answer
Correct option: A.
list [1] to list [5-1]
list [1] to list [5-1]
View full question & answer
MCQ 871 Mark
Which of the following syntax is there to Store partial array from element at index start to element at index last-i?
  • Array, start, last
  • B
    Array, last, start
  • C
    Start, last, array
  • D
    Last, start, array
Answer
Correct option: A.
Array, start, last
Array, start, last
View full question & answer
MCQ 881 Mark
If we give start and last position with sort method then what will it sort?
  • Partial (Starting to last-i position)
  • B
    Entire
  • C
    Only three elements
  • D
    None of these
Answer
Correct option: A.
Partial (Starting to last-i position)
Partial (Starting to last-i position)
View full question & answer
MCQ 891 Mark
What does sort method sort when we use only array as an argument?
  • An entire part of an array
  • B
    Last ten elements an of array
  • C
    First ten elements of an array
  • D
    Partial array
Answer
Correct option: A.
An entire part of an array
An entire part of an array
View full question & answer
MCQ 901 Mark
Which method can we use to sort array partly or fully?
  • A
    srt0
  • B
    st0
  • sort0
  • D
    arrsor0
Answer
Correct option: C.
sort0
sort0
View full question & answer
MCQ 911 Mark
Which of the following class contains methods sort () and fil0?
  • java.util.Arrays
  • B
    java.util.method
  • C
    java. Arrays
  • D
    java. Method
Answer
Correct option: A.
java.util.Arrays
java.util.Arrays
View full question & answer
MCQ 921 Mark
Methods of which of the following class does Java allow to use to perform operations on Array?
  • A
    Arr
  • Arrays
  • C
    Arys
  • D
    Java Array
Answer
Correct option: B.
Arrays
Arrays
View full question & answer
MCQ 931 Mark
Which method of class java.util.Arrays is used to perform various operations on array?
  • Static
  • B
    Instance
  • C
    Private
  • D
    All of these
Answer
Correct option: A.
Static
Static
View full question & answer
MCQ 941 Mark
Which class is provided by Java to use various static methods?
  • java.util.Arrays
  • B
    java. Arrays
  • C
    java. Method
  • D
    java.util. method
Answer
Correct option: A.
java.util.Arrays
java.util.Arrays
View full question & answer
MCQ 951 Mark
Which of the following operations can be performed on array?
  • A
    Compare two arrays
  • B
    Copy all the elements of one array to another
  • C
    Sort elements of array, Search specified element in array
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 961 Mark
Which operation do we need to use repeatedly to find an average of numbers in the program?
  • A
    Subtract number to sum
  • Add number to sum
  • C
    Divide number by 2
  • D
    None of these
Answer
Correct option: B.
Add number to sum
Add number to sum
View full question & answer
MCQ 971 Mark
Which statement is used to assign value 56 to the fourth element of an array named ‘m’?
  • m [3] = 56;
  • B
    m [4] =56;
  • C
    m (3) =56;
  • D
    m (4) = 56;
Answer
Correct option: A.
m [3] = 56;
m [3] = 56;
View full question & answer
MCQ 981 Mark
By using which of the following every element of an array is referred?
  • A
    Name
  • B
    Symbol
  • Index
  • D
    None of these
Answer
Correct option: C.
Index
Index
View full question & answer
MCQ 991 Mark
Which type of variable every element of an array is?
  • Different
  • B
    Same
  • C
    It depends on data type
  • D
    None of these
Answer
Correct option: A.
Different
Different
View full question & answer
MCQ 1001 Mark
What will be the result if an array object is not created and we try to access the elements of an array?
  • Error message
  • B
    Help message
  • C
    Alert message
  • D
    None of these
Answer
Correct option: A.
Error message
Error message
View full question & answer
MCQ - Page 2 - Computer STD 12 Commerce Questions - Vidyadip