Questions · Page 4 of 7

MCQ

MCQ 1511 Mark
The array size is same as the number of values specified in …………… .
  • braces 
  • B
    index 
  • C
    default value 
  • D
    initialization
Answer
Correct option: A.
braces 
(A) braces
View full question & answer
MCQ 1521 Mark
The array variable marks [5] has an index value from ………… .
  • A
    1 to 5 
  • 0 to 4 
  • C
    0 to 5 
  • D
    1 to 4
Answer
Correct option: B.
0 to 4 
(B) 0 to 4
View full question & answer
MCQ 1531 Mark
Array with ……….. dimension is known as 1-D array.
  • A
    double 
  • B
    triple 
  • C
    (A) and (B) both 
  • single
Answer
Correct option: D.
single
(D) single
View full question & answer
MCQ 1541 Mark
Using ……………  method of Calendar class we can set the field constants.
  • A
    Set 
  • B
    get 
  • set 
  • D
    Get
Answer
Correct option: C.
set 
(C) set
View full question & answer
MCQ 1551 Mark
………….. subclass of Calendar class is used in our syllabus.
  • A
    GeoCalendar 
  • GregorianCalendar 
  • C
    StandardCalendar 
  • D
    MainCalendar
Answer
Correct option: B.
GregorianCalendar 
(B) GregorianCalendar
View full question & answer
MCQ 1561 Mark
Date class facility is available in …………. package of Java.
  • A
    java.utilities 
  • B
    java.char 
  • java.util 
  • D
    java.prop
Answer
Correct option: C.
java.util 
(C) java.util
View full question & answer
MCQ 1571 Mark
What is the meaning of length for string object ?
  • A
    Method 
  • B
    Attribute 
  • C
    Function 
  • Properties
Answer
Correct option: D.
Properties
(D) Properties
View full question & answer
MCQ 1591 Mark
String are enclosed in ………….. brackets.
  • double quotes 
  • B
    sings quotes 
  • C
    curly 
  • D
    square
Answer
Correct option: A.
double quotes 
(A) double quotes
View full question & answer
MCQ 1601 Mark
What is a string ?
  • A
    One type of a character    
  • Series of characters
  • C
    Special type of character  
  • D
    None of these
Answer
Correct option: B.
Series of characters
(B) Series of characters
View full question & answer
MCQ 1621 Mark
Which property is used to count the number of elements in 1-D array ?
  • A
    total 
  • length 
  • C
    totaldig 
  • D
    number
Answer
Correct option: B.
length 
(B) length
View full question & answer
MCQ 1631 Mark
What is the meaning of ‘array within array’ in Java ?
  • A
    1-D array 
  • B
    Multi array 
  • 2-D array
  • D
    None of these
Answer
Correct option: C.
2-D array
(C) 2-D array
View full question & answer
MCQ 1641 Mark
In 2-D array, row is taken as …………… array element.
  • 1-D 
  • B
    infinite 
  • C
    2-D 
  • D
    multi
Answer
Correct option: A.
1-D 
(A) 1-D
View full question & answer
MCQ 1651 Mark
Maximum $………..$ dimension can be given to make $2-D $ array.
  • A
    $[8] [8] $
  • B
    $[255] [255] $
  • C
    $[16] [16] $
  • There is no limit
Answer
Correct option: D.
There is no limit
There is no limit
View full question & answer
MCQ 1661 Mark
How much size of occupied by marks variable by int marks [ ] [ ] = new int [5] [3] ?
  • A
    15 
  • 60 
  • C
  • D
    3
Answer
Correct option: B.
60 
(B) 60
View full question & answer
MCQ 1671 Mark
Size of ………… is indicated by first bracket in int marks [ ] [ ] = new int [5] [3].
  • rows 
  • B
    column 
  • C
    cell 
  • D
    none of these
Answer
Correct option: A.
rows 
(A) rows
View full question & answer
MCQ 1681 Mark
How many values can be stored using int marks [ ] [ ] = new int[5] [3] ?
  • A
  • B
  • 15 
  • D
    20
Answer
Correct option: C.
15 
(C) 15
View full question & answer
MCQ 1691 Mark
Pair of …………. brackets are used to declare 2-D array in java.
  • A
    ( ) ( ) 
  • [ ] [ ] 
  • C
    { } { } 
  • D
    < > < >
Answer
Correct option: B.
[ ] [ ] 
(B) [ ] [ ]
View full question & answer
MCQ 1701 Mark
What is the use of static method provided by java.util.Arrays class ?
  • A
    Compare two arrays 
  • B
    Find the particular element in array
  • C
    Sort the array
  • All of these
Answer
Correct option: D.
All of these
(D) All of these
View full question & answer
MCQ 1711 Mark
………… class method is given when array is used in java.
  • A
    Using private static 
  • Using public static 
  • C
    Using protect static 
  • D
    This is not possible
Answer
Correct option: B.
Using public static 
(B) Using public static
View full question & answer
MCQ 1721 Mark
…………. Class method is used to display the value of array elements.
  • A
    println() 
  • B
    printf() 
  • display() 
  • D
    displayed()
Answer
Correct option: C.
display() 
(C) display()
View full question & answer
MCQ 1731 Mark
If we initialize the values of variables directly then …………. Operator is not needed.
  • new 
  • B
    create 
  • C
    array name 
  • D
    all of these
Answer
Correct option: A.
new 
(A) new
View full question & answer
MCQ 1751 Mark
What do we give in the [] after the array name ?
  • A
    Index 
  • B
    Subscript 
  • both (A) and (B)
  • D
    None of these      
Answer
Correct option: C.
both (A) and (B)
(C) (A) or (B)
View full question & answer
MCQ 1761 Mark
……………. Method can be used to compare the given value with each element of an array.
  • Linear search 
  • B
    Random search 
  • C
    Only search 
  • D
    Non-linear method
Answer
Correct option: A.
Linear search 
(A) Linear search
View full question & answer
MCQ 1771 Mark
What does ‘length’ refer to for an object of String class ?
  • A
    Attribute 
  • Method 
  • C
    Class variable 
  • D
    Class name
Answer
Correct option: B.
Method 
(B) Method
View full question & answer
MCQ 1781 Mark
The change the elements with some other values, ………… method can be used.
  • fill 
  • B
    list 
  • C
    sort 
  • D
    full
Answer
Correct option: A.
fill 
(A) fill
View full question & answer
MCQ 1791 Mark
…………. Bracket is used to declare 1-D array.
  • A
    ( ) 
  • B
    { } 
  • [ ] 
  • D
    < >
Answer
Correct option: C.
[ ] 
(C) [ ]
View full question & answer
MCQ 1801 Mark
………. Type of list can be stored in 1-D array.
  • A
    Characters 
  • B
    Numbers 
  • (A) and (B) both 
  • D
    None of these
Answer
Correct option: C.
(A) and (B) both 
(C) (A) and (B) both
View full question & answer
MCQ 1811 Mark
Array can represent ……….. data.
  • A
    vector 
  • B
    matrix 
  • C
    multi-dimensional 
  • all of these
Answer
Correct option: D.
all of these
(D) all of these
View full question & answer
MCQ 1821 Mark
What is an array ?
  • A collection of homogeneous type of elements 
  • B
    A collection of different type of elements
  • C
    A collection representing different variable
  • D
    (A) or (C)
Answer
Correct option: A.
A collection of homogeneous type of elements 
(A) A collection of homogeneous type of elements
View full question & answer
MCQ 1831 Mark
When an array sales [5][12] is declared without specifying initial values, what is the initial value of sales[0][0] ?
  • A
  • B
    default value 
  • compilation error 
  • D
    60
Answer
Correct option: C.
compilation error 
(C) compilation error
View full question & answer
MCQ 1841 Mark
What will expression sales.length return for an array sales [5][12] ?
  • A
  • B
    12 
  • 60 
  • D
    120
Answer
Correct option: C.
60 
(C) 60
View full question & answer
MCQ 1851 Mark
What does ‘length’ refer to for an object of String class ?
  • A
    Attribute 
  • Method 
  • C
    Class variable 
  • D
    Class name
Answer
Correct option: B.
Method 
(B) Method
View full question & answer
MCQ 1861 Mark
When an array sales [5][12] is declared without specifying initial values, what is the initial value of sales[0][0] ?
  • A
  • B
    default value 
  • compilation error 
  • D
    60
Answer
Correct option: C.
compilation error 
(C) compilation error
View full question & answer
MCQ 1881 Mark
What is the size of second dimension in an array sales [5][12] ?
  • A
  • 12 
  • C
    60 
  • D
    10
Answer
Correct option: B.
12 
(B) 12
View full question & answer
MCQ 1891 Mark
What does 2 suggest in marks [2] ?
  • Index of element 
  • B
    Value of element 
  • C
    Total element 
  • D
    All of these
Answer
Correct option: A.
Index of element 
(A) Index of element
View full question & answer
MCQ 1911 Mark
……….. type of data can be stored in 2-D array.
  • A
    Tabular 
  • B
    Matrix 
  • (A) and (B) both 
  • D
    None of these
Answer
Correct option: C.
(A) and (B) both 
(C) (A) and (B) both
View full question & answer
MCQ 1921 Mark
Basic variable can store only one value. Such variable is known as ………… .
  • A
    constant variable 
  • B
    scalar variable 
  • C
    modular variable 
  • both (A) and (B)
Answer
Correct option: D.
both (A) and (B)
(D) (A) or (B)
View full question & answer
MCQ 1931 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 
(A) int
View full question & answer
MCQ 1941 Mark
Which of the following refer to the starting index value in array ?
  • B
  • C
    null 
  • D
    All of these
Answer
Correct option: A.
(A) 0
View full question & answer
MCQ 1951 Mark
If ‘str’ is the object of String class and its content is “Thank GOD”, then what is the value of str.length() ?
  • B
    10 
  • C
  • D
    11
Answer
Correct option: A.
(A) 9
View full question & answer
MCQ 1961 Mark
How many bytes are used to store integer value using int data type ?
  • A
  • B
  • D
    Only one
Answer
Correct option: C.
(C) 8
View full question & answer
MCQ 1971 Mark
Which constant of Calendar class will return Day number within a week ?
  • A
    DAY
  • B
    DAY_WEEK
  • DAYS_OF_WEEK
  • D
    Day_Of_Week
Answer
Correct option: C.
DAYS_OF_WEEK
C
View full question & answer
MCQ 1981 Mark
What is used to create a String object which is same as object specified in argument?
  • String (String strObj)
  • B
    String (string literal)
  • C
    String (char ary[ ], int start, int len)
  • D
    String ( )
Answer
Correct option: A.
String (String strObj)
A
View full question & answer
MCQ 1991 Mark
In the following statement for declaring two-dimensional array of Java 5 represents What ?
int marks[ ] [ ]=new int[5] [3] ;
  • number of rows
  • B
    number of columns
  • C
    array size
  • D
    number of bytes
Answer
Correct option: A.
number of rows
A
View full question & answer
MCQ 2001 Mark
Which of the following are used to declare 2D array ?
  • Array name and two pairs of [ ]
  • B
    Array type and array name
  • C
    Array name and two pairs of { }
  • D
    Array type and two pairs of { }
Answer
Correct option: A.
Array name and two pairs of [ ]
A
View full question & answer
MCQ - Page 4 - COMPUTER STD 12 Science Questions - Vidyadip