Questions · Page 5 of 7

MCQ

MCQ 2011 Mark
What will be the index value array if array is initialized with following values ? int marks[ ]={70, 80, 85, 90, 100};
  • A
    0 to 5
  • 0 to 4
  • C
    1 to 5
  • D
    1 to 4
Answer
Correct option: B.
0 to 4
B
View full question & answer
MCQ 2021 Mark
Which of the following is/are the proper example/s of declaring an array with initial values of data elements?
  • A
    int marks[ ]={90,70,77);
  • B
    int [ ] marks={90, 70, 77);
  • Both A & B
  • D
    int marks [90, 70, 77];
Answer
Correct option: C.
Both A & B
C
View full question & answer
MCQ 2031 Mark
By using which of the following class we can use various static methods provided by Java?###Sort( ) and Fill( ) are methods of which of the following Java class?
  • A
    Array.java.data
  • java.util.Arrays
  • C
    util.Array.java
  • D
    Array.java.fill
Answer
Correct option: B.
java.util.Arrays
B
View full question & answer
MCQ 2041 Mark
What is used to refer an element of an array ?
  • A
    { }
  • B
    Array content
  • Index or subscript
  • D
    Element reference
Answer
Correct option: C.
Index or subscript
C
View full question & answer
MCQ 2051 Mark
Which of the following steps are used to create an array ?
  • A
    Declare an array object
  • B
    Create an array object
  • Both A & B
  • D
    Specify the size
Answer
Correct option: C.
Both A & B
C
View full question & answer
MCQ 2081 Mark
If 'str' is the object of String class and its content is "Thank GOD", then what is the value of str.length() ?
  • 9
  • B
    10
  • C
    8
  • D
    11
Answer
Correct option: A.
9
A
View full question & answer
MCQ 2091 Mark
Which array class method is used to search an element in an array?
  • A
    Search( )
  • binarySearch( )
  • C
    binary( )
  • D
    SearchArray( )
Answer
Correct option: B.
binarySearch( )
B
View full question & answer
MCQ 2101 Mark
Which constant of Calendar class will return Day of calendar month?
  • A
    Day
  • B
    DayOfCal
  • DATE
  • D
    DATECal
Answer
Correct option: C.
DATE
C
View full question & answer
MCQ 2121 Mark
Which of the following can be represented by Arrays ?
  • A
    Vector
  • B
    Matrix
  • C
    Multi-dimensional data
  • All A, B & C
Answer
Correct option: D.
All A, B & C
D
View full question & answer
MCQ 2131 Mark
Which constant of Calendar class will return Hours in 12 hour notation ?
  • HOUR
  • B
    HourOfTime
  • C
    Hour_Of_Time
  • D
    HOUR_Time
Answer
Correct option: A.
HOUR
A
View full question & answer
MCQ 2141 Mark
Which Java classes are used to handle strings ?
  • String and StringBuffer
  • B
    String and Buffer
  • C
    Buffer and String.Java
  • D
    Strings and Buffer.Java
Answer
Correct option: A.
String and StringBuffer
A
View full question & answer
MCQ 2151 Mark
What is used to declare-a 1- D array ?###In Java, how can be array elements accessed using index for each dimension ?
  • A
    { }
  • [ ]
  • C
    ( )
  • D
    < >
Answer
Correct option: B.
[ ]
B
View full question & answer
MCQ 2161 Mark
Which arrays are used to store tabular data in the form of rows and columns ?
  • A
    Two dimensional
  • B
    2 - D
  • Both A & B
  • D
    1 - D
Answer
Correct option: C.
Both A & B
C
View full question & answer
MCQ 2171 Mark
What is used as a separator of 1 - D array values ?
  • A
    ; (Semi colon)
  • B
    + (Plus)
  • , (Comma)
  • D
    - (Hyphen)
Answer
Correct option: C.
, (Comma)
C
View full question & answer
MCQ 2181 Mark
Which of the following refer to the starting index value in arrays ?
  • $0$
  • B
    1
  • C
    null
  • D
    All of these
Answer
Correct option: A.
$0$
A
View full question & answer
MCQ 2191 Mark
Which of the following will create a String object with no character?
  • A
    String (char ary[ ])
  • B
    String (String strObj)
  • C
    String (string literal)
  • String ( )
Answer
Correct option: D.
String ( )
D
View full question & answer
MCQ 2201 Mark
Which constant of Calendar class will return Day number in the year?
  • A
    DayOfYear
  • B
    Day_Year
  • DAY_OF_YEAR
  • D
    DaysOfYear
Answer
Correct option: C.
DAY_OF_YEAR
C
View full question & answer
MCQ 2211 Mark
What is used to create a String object using 1 - Dary argument starting at ary[start] with len number of characters ?
  • A
    String (String strObj)
  • B
    String (string literal)
  • String (char ary[ ], int start, int len)
  • D
    String (char ary[ ])
Answer
Correct option: C.
String (char ary[ ], int start, int len)
C
View full question & answer
MCQ 2221 Mark
Which method is used to fill the whole or partial array with specified value ?
  • A
    Sort
  • B
    Insert
  • Fill
  • D
    Add
Answer
Correct option: C.
Fill
C
View full question & answer
MCQ 2231 Mark
Which brackets are used to represent values of data elements in 1- D array ?
  • { }
  • B
    [ ]
  • C
    ( )
  • D
    < >
Answer
Correct option: A.
{ }
A
View full question & answer
MCQ 2241 Mark
Which of the following are useful when some options are to be performed on various elements of the similar type ?
  • A
    Class
  • Arrays
  • C
    Object
  • D
    Methods
Answer
Correct option: B.
Arrays
B
View full question & answer
MCQ 2251 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
View full question & answer
MCQ 2261 Mark
What is used to refer an element of an array?
  • A
    { }
  • B
    Array content
  • Index or subscript
  • D
    Element reference
Answer
Correct option: C.
Index or subscript
C
View full question & answer
MCQ 2271 Mark
Which constant of Calendar class will return Year of calendar?
  • A
    CalYear
  • B
    YearOfCal
  • YEAR
  • D
    Calendar Year
Answer
Correct option: C.
YEAR
C
View full question & answer
MCQ 2281 Mark
What is used as a separator of 1 - D array values?
  • A
    ; Semi colon
  • B
    + Plus
  • , Comma
  • D
    - hyphen
Answer
Correct option: C.
, Comma
C
View full question & answer
MCQ 2291 Mark
Which of the following are used to declare 2 - D 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 2301 Mark
Which property of 1 - D array is used to know the size of each row?
  • A
    Define
  • B
    Size
  • C
    Measure
  • Length
Answer
Correct option: D.
Length
D
View full question & answer
MCQ 2311 Mark
In which manner, all the elements of an array are stored in memory storage space?
  • A
    Random
  • B
    Separated
  • Contiguous
  • D
    Any A, B, C
Answer
Correct option: C.
Contiguous
C
View full question & answer
MCQ 2321 Mark
Which Java classes are used to handle strings?
  • String and StringBuffer
  • B
    String and Buffer
  • C
    Buffer and String.Java
  • D
    Strings and Buffer.Java
Answer
Correct option: A.
String and StringBuffer
A
View full question & answer
MCQ 2331 Mark
What can we use instead of 'array of characters', to save space?
  • Array of bytes
  • B
    Array of numbers
  • C
    Array of ASCII
  • D
    Array of strings
Answer
Correct option: A.
Array of bytes
A
View full question & answer
MCQ 2341 Mark
Which method does construct Date object using current system time?
  • A
    Date (Time)
  • B
    long getTime( )
  • Date( )
  • D
    Date (long elapsedTime)
Answer
Correct option: C.
Date( )
C
View full question & answer
MCQ 2351 Mark
Which method does return a string after appending str with the invoking string?
  • A
    String toLowerCase( )
  • String concat(String str)
  • C
    String toUpperCase( )
  • D
    byte[] getBytes( )
Answer
Correct option: B.
String concat(String str)
B
View full question & answer
MCQ 2361 Mark
By using which of the following class we can use various static methods provided by Java?
  • A
    Array.java.data
  • B
    java.util.Arrays
  • C
    util.Array.java
  • D
    Array.java.fill
Answer
B


View full question & answer
MCQ 2381 Mark
Which constant of Calendar class will return same value as DATE ?
  • A
    DAY
  • B
    DayOfMonth
  • C
    DateOfMonth
  • DAY_OF_MONTH
Answer
Correct option: D.
DAY_OF_MONTH
D
View full question & answer
MCQ 2391 Mark
Which methods are used to set the value of the field constants of Calendar class ?
  • A
    Get
  • Set
  • C
    Display
  • D
    Show
Answer
Correct option: B.
Set
B
View full question & answer
MCQ 2411 Mark
Length' represents what with String object ?
  • A
    Attribute
  • B
    Property
  • C
    Class
  • Method
Answer
Correct option: D.
Method
D
View full question & answer
MCQ 2421 Mark
Which method does return an array of characters as bytes from invoking string?
  • byte[ ] getBytes( )
  • B
    void getChars(int targetIndx)
  • C
    String toLowerCase( )
  • D
    char indexAt(int index)
Answer
Correct option: A.
byte[ ] getBytes( )
A
View full question & answer
MCQ 2431 Mark
Which of the following method does return true if invoking string is same as str ?
  • A
    booleanequalsIgnoreCase (String str)
  • boolean equals(String str)
  • C
    intcompareTo(String str)
  • D
    intcompareToIgnoreCase(String str)
Answer
Correct option: B.
boolean equals(String str)
B
View full question & answer
MCQ 2441 Mark
Which operator is used to allocate separate memory, when string objects are created and strings are identical ?
  • A
    NewString
  • B
    StringNew
  • C
    NewObject
  • New
Answer
Correct option: D.
New
D
View full question & answer
MCQ 2461 Mark
Which of the following can create a String object with its initial value using ary argument ?
  • A
    String ( )
  • B
    String (char ary[], int start, intlen)
  • String (char ary[ ])
  • D
    String (String strObj)
Answer
Correct option: C.
String (char ary[ ])
C
View full question & answer
MCQ 2471 Mark
What of the following is a sequence of characters ?
  • A
    Array
  • String
  • C
    String Buffer
  • D
    Alphanumeric values
Answer
Correct option: B.
String
B
View full question & answer
MCQ 2481 Mark
Which method is used to sort entire or part of an array ?
  • A
    Fill( )
  • B
    Psort( )
  • C
    Asort( )
  • Sort( )
Answer
Correct option: D.
Sort( )
D
View full question & answer
MCQ 2491 Mark
By using which of the following class we can use various static methods provided by Java ?
  • A
    Array.java.data
  • java.util.Arrays
  • C
    util.Array.java
  • D
    Array.java.fill
Answer
Correct option: B.
java.util.Arrays
B
View full question & answer
MCQ - Page 5 - COMPUTER STD 12 Science Questions - Vidyadip