Home / HSC(ENG) - GSEB Board / Reading Mode

๐Ÿ“– Reading Mode: HSC(ENG) - GSEB Board

Chapter: Working with Array and String โ€ข Total: 262 MCQs

MCQ 1 Strings

In java,how many bytes are used to store charactres ?

A 1
B 3
C 2
D 4
MCQ 2 Date Class

In java library,which of the following packagesย is used to provid Date class and Calender class ?

A java.util
B java.util.Arrays
C java.io
D java.lang
MCQ 3 Strings class methods

In string class,which of the following method is used to return a string after appending str with the invoking string ?

A String Add(String str)
B String Concat(String str)
C String toLowerCase( )
D String Append(String str)
MCQ 4 Strings class methods

Which operator is used, when string objects have Separate allocated memory and are identical?

A literal
B new
C create
D (A)and(B)both
MCQ 5 1-D Array

What will be the value of m(4) elements in the given statement? int m[]={90,60,70,65,80}

A 65
B 80
C 60
D 70
MCQ 6 Date Class

In date class, which method is used to construct date object using specify time in milliseconds elapsed since January 1, 1970 GMT?

A Date()
B Long getTime()
C Date ( long elapsedTime )ย 
D String toString()
MCQ 7 Introduction of Array

In java, which of the following is an object used to mange list of items?

A Array
B Form
C Window
D Document
MCQ 8 Strings class methods

which object is using length method?

A Array
B String
C Date
D Calendarย 
MCQ 9 Strings class methods

What will be the output of given java program? { String str1="india"; String str2="INDIA"; System.out.println(str1.compartTo(str2)); }

A 0
B >0
C 32
D -32
MCQ 10 2-D Array

What will be the result of given java program? { ย ย  ย int P[][]={{1,3,5,7},{2,4,6,8}}; ย ย  ย System.out.println((P[0][1]-P[1][3])) }

A -5
B -3
C 5
D 3
MCQ 11 Strings

WHICH STRING CONSTRUCTOR IS USED WITHOUT ARGUMENT TO CREATE A STRING OBJECT WITH NO CHARACTERS.

A STRING()
B STRING (CHAR ARY [])
C STRING (SSO)
D STRING (STR LITERAL)
MCQ 12 1-D Array

IN JAVA, TO SEARCH AN ELEMENT IN AN ARRAY, ARRAY CLASS PROVIDES WHICH TYPE OF METHOD.

A FILL()
B BINARYSEARCH()
C SORT()
D REMOVE()
MCQ 13 1-D Array

WHICH TYPE OF BRACE IS USED TO INITIALIZE DATA ELEMENT IN 1-D ARRAY.

A <>
B []
C {}
D ()
MCQ 14 Strings class methods

IN JAVA,IF STR IS THE OBJECT OF STRING CLASS AND ITS CONTENT IS "HELLO" THEN WHAT IS THE VALUE OF STR.LENGTH().

A 8
B 7
C 6
D 5
MCQ 15 Strings class methods

WHICH METHOD OF STRING CLASS IS USED TO RETURN A STRING WITH ALL CHARACTERS OF INVOKING STRING.

A int length()
B byte[] getBytes()
C char indexAt(int index)
D String concate(String str)
MCQ 16 2-D Array

WE CAN USE VARIOUS STATIC METHODS PROVIDED BY JAVA USING WHICH ARRAY CLASS.

A JAVA.UTIL.ARRAYS
B JAVA.JO
C JAVA.LANG
D ALL OF THESE
MCQ 17 Date Class

WHICH METHOD OF DATE CLASS CONSTRUCTS DATE OBJECT USING CURRENT SYSTEM TIME IN JAVA?

A DATE & TIME()
B TODAYS DATE()
C DATE()
D NOW()
MCQ 18 2-D Array

WHAT IS THE SIZE OF SECOND DIMENSION IN AN ARRAY SALES? sales[5][12]

A 12
B 5
C 60
D 11
MCQ 19 Introduction of Array

ARRAYS ARE USEFUL TO REPRESENT WHICH TYPE OF DATA IN JAVA?

A VECTOR
B MATRIX
C MULTI
D ALL OF THESE
MCQ 20 Introduction of Array

WHICH STEPS ARE FOLLOWED FOR THE PROCESS OF CREATION OF ARRAY IN JAVA.

A DECLARE AN ARRAY
B DECLARE AN ARRAY
C DECLARE AN ARRAY
D DECLARE AN ARRAY
MCQ 21 Introduction of Array

What does length refer to for an object of String class?

A Attribute
B Method
C class variable
D class name
MCQ 22 Introduction of Array

What do we call the basic data type which can store only one value at a time?

A Scalar variable
B Local variable
C Static variable
D Instance variable
MCQ 23 Introduction of Array

What do we call the data type that can be used to store a collection of more than one data values?

A Scalar
B Composite
C Constructor
D Basic
MCQ 24 Introduction of Array

Which of the following is a variable representing a collection of homogeneous type of elements?

A Array
B Method
C Class
D Object
MCQ 25 Introduction of Array

โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ..is useful to represent vector, matrix, and other multi -dimensional data.

A Array
B Method
C Class
D Object
MCQ 26 Introduction of Array

โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆis a 1D data structure that can be used to store list of items in Java.

A Vector
B Matrix
C Composite
D Static
MCQ 27 Introduction of Array

โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ.is used to represent 2 โ€“ D data structure.

A Vector
B Matrix
C Composite
D Static
MCQ 28 Introduction of Array

Which of the following is useful when same operation is to be performed on various elements of similar type?

A Array
B Constructor
C Method
D Object
MCQ 29 Introduction of Array

How do we identify each element of array?

A By an index position
B By a pointer
C By memory allocation
D All of above
MCQ 30 Introduction of Array

An index position of an array is associated with array โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ..

A class
B variable
C Method
D function
MCQ 31 Introduction of Array

Creating an array is how many steps process?

A Declare an array object
B Create an array object
C declare an array class
D Both a and b
MCQ 32 Introduction of Array

An array object can be created in how many ways?

A Using new operator and specifying the size
B Directly initializing the content of array
C Specify the size
D Both a and b
MCQ 33 Introduction of Array

To declare 1โ€“D array we use a pair of โ€ฆโ€ฆโ€ฆโ€ฆ..brackets after array name or after data type.

A [ ]
B { }
C ( )
D < >
MCQ 34 Introduction of Array

Write down the various ways to create Array object named โ€œmarksโ€ with size for 5 elements

A int marks[ ]; marks = new int [5];
B int marks [ ] = new int [5];
C int [] marks = new int [5];
D All of above
MCQ 35 Introduction of Array

How many bytes are used to store the int marks[ ] = new int [5] array?

A 5 X 4=20
B 5 X 8=40
C 5 X 2 =10
D 5 X 1 =5
MCQ 36 Introduction of Array

What specifies the position of an element in an array?

A index
B serial
C number
D class
MCQ 37 Introduction of Array

If we declare โ€œint marks[ ]=new int [5];โ€ array then what is its first and last element?

A First is marks[0] & Last is marks[4]
B First is marks[1] & Last is marks[5]
C First is marks[4] & Last is marks[0]
D First is marks[5] & Last is marks[1]
MCQ 38 Introduction of Array

Index value of an array always starts from โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆnumber.

A 0 (zero)
B 1
C 2
D 3
MCQ 39 Introduction of Array

1-D array is initialized using โ€ฆโ€ฆโ€ฆโ€ฆ..sign to separate values of data elements in โ€ฆโ€ฆ.braces.

A , and { }
B ; and { }
C , and ( )
D ; and ( )
MCQ 40 Introduction of Array

Which of the following an example of data element of array?

A int marks[ ]={90,70,77};
B int marks[3]={90,70,77};
C int marks[ ]=(90,70,77);
D int marks[ ]={90;70;77};
MCQ 41 Introduction of Array

In java, we can not specify both the size of โ€ฆโ€ฆโ€ฆ.. and โ€ฆโ€ฆโ€ฆ.values of the array elements simultaneously while declaring an array.

A dimensions
B initial
C class
D Both a and b
MCQ 42 Introduction of Array

Various array static methods provided by Java in โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ.class.

A java.util.Arrays
B java.util.Array
C java.io.Arrays
D java.util.io.Arrays
MCQ 43 Introduction of Array

Which method to sort entire or part of array?

A sort( )
B Short( )
C fill( )
D unique( )
MCQ 44 Introduction of Array

Which method is used to fill the whole or partial array with specified value?

A fill( )
B sort( )
C put( )
D short( )
MCQ 45 Introduction of Array

If you want to assigns value 7 to all elements of list array then which method is used?

A fill (list, 7)
B fill (ls,7)
C sort(list,7)
D fill(7)
MCQ 46 Introduction of Array

What will done with command โ€œfill (list, 2,6,5);โ€.

A Assigns array list value 5 to element list [2] to list[6-1]
B Assigns array list value 6 to element list [2] to list[5-1]
C Assigns array list value 5 to element list [5] to list[6-1]
D None of these
MCQ 47 Introduction of Array

To search an element in an array then array class provides which method?

A Linear search
B binarySearch( )
C binary
D search()
MCQ 48 Introduction of Array

Which method in Java, is used to search element by element comparison in a serial fashion?

A Linear search
B binarySearch( )
C binary
D find()
MCQ 49 Introduction of Array

Which of the following arrays are used to store tabular data in the form of rows and columns?

A 1D
B 2D
C single
D three dimension
MCQ 50 Introduction of Array

If we write โ€œint marks [ ][ ]=new int [5][3]โ€ then which view shows the elements of array in a table of 5 rows and 3 columns?

A Logical view
B Physically view
C index view
D Display view
MCQ 51 Introduction of Array

In Java, which view of array is stored in memory using contiguous memory?

A Logical view
B Physically view
C index view
D Display view
MCQ 52 Introduction of Array

In statement โ€œint marks [ ][ ]=new int [5][3]โ€ occupy how many memory?

A 15 (5*3) integers that store 60 (15*4) bytes
B 15 (5*3) integers that store 15 bytes
C 15 (5*3) integers that store 30 (15*2) bytes
D 15 (5*3) integers that store 0 bytes
MCQ 53 Introduction of Array

Java does not support โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ.type of an array.

A 1D
B 2D
C multi-dimensional
D Both b and c
MCQ 54 Introduction of Array

To initialize 2-D array, all these initialized rows are to be enclosed in โ€ฆโ€ฆโ€ฆโ€ฆ. braces.

A Curly { }
B Square [ ]
C circle ( )
D angular < >
MCQ 55 Introduction of Array

In 2-D array all elements in curly braces are separated by โ€ฆโ€ฆโ€ฆโ€ฆ..sign.

A comma (,)
B semicolon (;)
C colon( : )
D dot (.)
MCQ 56 Introduction of Array

Size of each row can be known using โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ.. property of 1-D array.

A length
B size
C width
D row
MCQ 57 Introduction of Array

Declaring an array without โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ..does not create an array object.

A initialization
B Declaration
C Instantiation
D None of these
MCQ 58 Introduction of Array

1-D array of characters can be considered as aโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ..

A integer
B character
C String
D long
MCQ 59 Introduction of Array

Java supports two .types of strings that are handled by which of the following class?

A String
B StringBuffer
C character
D Both a and b
MCQ 60 Introduction of Array

โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆconstructor is used without arguments create a string object with no character.

A String ( )
B str( )
C string( )
D char()
MCQ 61 Introduction of Array

Which type of constructor creates a string object with its initial values using array argument?

A String (char ary[ ])
B String (char ary[ ], int start, int len)
C String (String strObj)
D String (string literal)
MCQ 62 Introduction of Array

Which of the following constructor creates a String object using 1-D array argument starting at ary [start] with len number of character?

A String (char ary[ ])
B String (char ary[ ], int start, int len)
C String (String strObj)
D String (string literal)
MCQ 63 Introduction of Array

Which of the following constructor creates a String object which is same as object specified in argument?

A String (char ary[ ])
B String (char ary[ ], int start, int len)
C String (String strObj)
D String (string literal)
MCQ 64 Introduction of Array

Which of the following constructor creates a String object that refers to the literal specified in argument?

A String (char ary[ ])
B String (char ary[ ], int start, int len)
C String (String strObj)
D String (string literal)
MCQ 65 Introduction of Array

When two String objects are created using same string literals, memory space is not allocated for โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ object.

A second
B first
C zero
D null
MCQ 66 Introduction of Array

Separate memory is allocated when string objects are created using โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ..operator.

A new
B obj
C static
D private
MCQ 67 Introduction of Array

What happen when we create a String object st1 and st2 without using new operator?

A st1 and st2 refer to the same instance as created for st1.
B Both st1 and st2 refer to different memory location.
C Only st2 refer to different memory location.
D Only st1 refer to different memory location.
MCQ 68 Introduction of Array

What happen when we create a String object st1 and st2 using new operator?

A st1 and st2 refer to the same instance as created for st1.
B Both st1 and st2 refer to different memory location.
C Only st2 refer to different memory location.
D Only st1 refer to different memory location.
MCQ 69 Introduction of Array

In statement โ€œString st1=new String(โ€œI love Indiaโ€);โ€ what do we call st1?

A Reference variable
B String object
C String class
D character class
MCQ 70 Introduction of Array

In statement โ€œString st1=new String(โ€œI love Indiaโ€);โ€ what do we call โ€œI love Indiaโ€?

A String Object
B reference variable
C string class
D character class
MCQ 71 Introduction of Array

Which class provides methods to compare strings, find length of string, combining strings, obtaining sub strings, converting strings, splitting strings, searching for character or pattern in string etc?

A String Class
B Character class
C Binary class
D bytecode class
MCQ 72 Introduction of Array

Which method returns an array of characters as byte from invoking string?

A int length( )
B byte [ ] getBytes( )
C String(Bytes)
D getBytes( )
MCQ 73 Introduction of Array

Which of the following string class method returns number of characters in invoking string?

A int length( )
B int LENGTH( )
C int Length( )
D Float int length( )
MCQ 74 Introduction of Array

Date and Calendar class is provided in which of the following package?

A java.class
B java.util
C java.dc
D java.dateclass
MCQ 75 Introduction of Array

Which class encapsulate both date and time and represents the value using milliseconds precision?

A Date
B Calendar
C date
D DATE
MCQ 76 Introduction of Array

Which of the following Date method constructs Date object using current system time?

A Date (long ())
B Date( )
C Date (cur( ))
D Date [date()]
MCQ 77 Introduction of Array

Which method returns a string representing date and time of invoking object?

A long getTime( )
B String toString( )
C String( )
D Date (Long ElapsedTime)
MCQ 78 Introduction of Array

Which method sets new date and time of an object using elapsed time?

A void setTime(long elapsedTime)
B long getTime( )
C Date( )
D Date(elapsed time)
MCQ 79 Introduction of Array

Which method constructs Date object using specified time in milliseconds elapsed since January 1, 1970 GMT?

A Date (long elapsedTime)
B Date ( )
C Date(time)
D Time(Date)
MCQ 80 Introduction of Array

Which method returns nimber of milliseconds since January 1, 1970 GMT?

A long getTime( )
B String toString( )
C Date( )
D Date(Time)
MCQ 81 Introduction of Array

Which class can be used to extract detailed calendar information like year, month, minute etc.

A Date class
B Calendar class
C calendar class
D CALENDAR class
MCQ 82 Introduction of Array

Which is the subclass of Calendar class?

A GregorianCalendar
B gregoriancalendar
C cal
D calendargregorian
MCQ 83 Introduction of Array

What is the set value of statement โ€œcalendar.set(Calendar.DATE,20);โ€?

A set 20 as date of current month
B Set date to 20 of system month
C set date above 20 of system month
D set date below 20 of system month
MCQ 84 Introduction of Array

Which constant of Calendar class set day of calendar month?

A DATE
B Date ( )
C date ( )
D Today()
MCQ 85 Introduction of Array

Which constant of Calendar class set minutes?

A Minute( )
B MINUTE
C Min( )
D minute( )
MCQ 86 Introduction of Array

Which constant of Calendar class set seconds?

A SECOND
B Second ( )
C second( )
D millisecond( )
MCQ 87 Introduction of Array

Which constant of Calendar class set week number within the month?

A WEEK_OF_MONTH
B WEEK.OF.MONTH
C weekof month
D week-of-month
MCQ 88 Introduction of Array

Which constant of Calendar class set week number within the year?

A WEEK_OF_YEAR
B WEEK.OF.YEAR
C weekofyear
D week-of-year
MCQ 89 Calender class

Which constant of Calendar class set day number in the year (1 for the first day)?

A DAY.OF.YEAR
B DAY_OF_YEAR
C day-of-year
D dayofyear
MCQ 90 Introduction of Array

Which constant of Calendar class set Day number within a week (1 for Sunday, 7 for Saturday)?

A DAY_OF_WEEK
B WEEK_OF_DAY
C week-of-week
D day-of-week
MCQ 91 Introduction of Array

Which constant of Calendar class is similar as DATE constant?

A DAY_OF_MONTH
B WEEK_OF_MONTH
C day-of-month
D week-of-month
MCQ 92 Introduction of Array

Method toString( ) returns answer in which data type?

A char
B String
C int
D float
MCQ 93 Introduction of Array

Method getTime( )returns answer in which data type?

A long
B float
C int
D String
MCQ 94 Introduction of Array

Which constant of Calendar class set 0 (Zero) for AM and 1 for PM?

A AM.PM (
B AM_PM
C am_pm
D am.pm
MCQ 95 Introduction of Array

In which format GregorianCalendar class constructor takes Date values?

A MM-DD-YYYY
B YYYY-MM-DD
C YY-MM-DD
D MM-DD-YY
MCQ 96 Introduction of Array

What is the output of statement โ€œDate( );โ€?

A Current system date and time
B Only date
C Only time
D set date and time
MCQ 97 Introduction of Array

If Today is โ€œTuesdayโ€ then what is the output of statement โ€œc1.get(Calendar.DAY_OFWEEK);โ€?

A 3
B 2
C 1
D 4
MCQ 98 Introduction of Array

What is the output of statement โ€œSystem.out.println(str1.equals(str2) );โ€ if content of srt1 and str2 is โ€œIndiaโ€?

A TRUE
B FALSE
C Yes
D No
MCQ 99 Introduction of Array

What is the size of second dimension in an array gseb [5] [3]?

A 15
B 3
C 5
D 18
MCQ 100 Introduction of Array

Which of the following constructor is used for without argument create a string object with no character?

A String[ ]
B String{ }
C String ( )
D String< >
MCQ 101 Introduction of Array

Which of the following string class method returns true if invoking string is same as str?

A Boolean Equal (string str)
B Boolean equals ( String str)
C Boolean eq (string str)
D Boolean Eq (string str)
MCQ 102 Introduction of Array

Which of the following is useful to represent vector, matrix and other multidimensional data?

A Array
B Variable
C Element
D Tag
MCQ 103 Introduction of Array

Which of the following refer to the starting index value in arrays?

A 0 (zero)
B 1
C null
D All of these
MCQ 104 Introduction of Array

If int marks[ ] = {1,2,3,4,5); is defined in Java then what will be the value of marks[3]?

A 4
B 3
C 2
D 5
MCQ 105 Introduction of Array

Which of the following is not a right statement to declare an array named marks in Java?

A int marks[ ]=new int [3]
B int [ ] marks = new int[3]
C int marks[3] = {50,60,70}
D int marks[ ]= {10,20,30}
MCQ 106 Introduction of Array

In Java, which of the following methods of string class returns a string after appending str with the invoking string?

A char indexAt(int index)
B byte[ ] getBytes( )
C String concat (String str)
D String append(String str
MCQ 107 Introduction of Array

In Java, if โ€žstrโ€Ÿ is the object of string class and its content is @Thank GOD@, then what is the value of str.length( )?

A 9
B 10
C 11
D 8
MCQ 108 Introduction of Array

Which method of java.util.Arrays class is used to fill the whole or partial array with specified value?

A fill( )
B sort( )
C put( )
D print( )
MCQ 109 Introduction of Array

Which of the following symbol signifies the start and end of a JavaScript block?

A semicolon
B square bracket
C curly bracket
D round bracket
MCQ 110 Introduction of Array

In Java, int compareto(String str) method returns which value if invoking string is equal to str?

A 0 zero
B > 0
C <0
D -1
MCQ 111 Introduction of Array

In Java, which constant of calender class will display day number in the year?

A DAY OF YEAR
B DAY
C DAY_OF_MONTH
D DAY OF WEEK
MCQ 112 Introduction of Array

In Java, which of the following methods calls sort elements of array โ€˜listโ€™ from list [1] to list [5-1] ?

A sort (list)
B java.sort (list)
C java.util.Arrays.sort (list, 1, 5)
D java.util.sort (list, 5)
MCQ 113 Introduction of Array

In Java, which property of 1-D array is used to know size of each row?

A size
B length
C sort
D fill
MCQ 114 Introduction of Array

In Java, how many integer values can be stored using following array? int marks [] [] = new int [4] [4]; .

A 4
B 8
C 16
D 64
MCQ 115 Introduction of Array

In Java, which of the following is a proper example of initializing 1-D array? (i) int marks [3]= {90,100,110}; (i) int marks[] = {90,100,110}; (iii) int[] marks = {90,100,110};

A only (i)
B (i) and (ii)
C (i) and (iii)
D (ii) and (iii)
MCQ 116 Introduction of Array

Which of the following methods of string class of Java returns true if invoking string is same as str after ignoring case?

A boolean equals ignore case (string str)
B int compare To (string str)
C boolean equals (string str)
D int length()
MCQ 117 Introduction of Array

In Java, which of the following are useful when same operations are to be performed on various elements of the similar type?

A Operators
B Arrays
C Files
D Comments
MCQ 118 Introduction of Array

In Java, how many arguments are required to fill partial array?

A 2
B 3
C 4
D 5
MCQ 119 Introduction of Array

Which kind of variables are of basic data types and can store only one value at a time?

A Array variables
B 1-D variables
C 2-D variables
D Scalar variables
MCQ 120 Introduction of Array

In Java which method of date class returns number of milliseconds since January1, 1970 GMT?

A Date (long elapsedTime)
B long getTime ( )
C Date ( )
D void setTime (long elapsedTime)
MCQ 121 Introduction of Array

Which of the following is a one-dimensional data structure that can be used to store list of items like characters, numbers?

A vector
B matrix
C row
D column
MCQ 122 Introduction of Array

Which of the following methods does element by element comparison in a serial fashion?

A Binary Search ( )
B Linear Search
C Random Search
D Numerical Search
MCQ 123 Introduction of Array

In Java, what is the size of row in following array? int marks [ ] [ ] = new int [4] [3);

A 3
B 12
C 7
D 4
MCQ 124 Introduction of Array

In 1-D array of Java, which of the following symbols is used to separate elements in a pair of { } braces?

A Comma
B Plus
C Underscore
D Space
MCQ 125 Introduction of Array

In Java, which of the following are useful when same operations are to be performed on various elements of the similar type?

A Arrays
B Variables
C Characters
D String
MCQ 126 Introduction of Array

How many arguments are required to fill partial array in Java?

A 3
B 4
C 2
D 1
MCQ 127 Introduction of Array

In Java, which of the following classes contains methods like sort ( ) and fill ( )?

A java.lang
B Arrays.java
C java.util.Arrays
D util.Arrays
MCQ 128 Introduction of Array

Which of the following constructors can create a string object with its initial value using โ€˜aryโ€™ argument?

A string ( )
B string (string strobj)
C string (string literal)
D string (char ary[ ])
MCQ 129 Introduction of Array

In 1-D array of Java, which property is used to know size of each row?

A size
B float
C length
D width
MCQ 130 Introduction of Array

What will be the value of the element J [2] in the following array in Java? int J [ ] = {70, 31, 10, 45, 50};

A 31
B 2
C 10
D J [2]
MCQ 131 Introduction of Array

Which of the following is the correct syntax to declare Array in Java?

A &lt; array name&gt;[ ]&lt; data type&gt;;
B &lt; array name&gt; &lt; data type&gt; [ ];
C &lt; array name&gt; &lt; class name&gt;[];
D &lt; data type&gt; &lt; array name&gt; [ ] ;
MCQ 132 Introduction of Array

In Java, which of the following is used to represent a collection of homogeneous type of elements?

A function
B array
C procedure
D switch
MCQ 133 Introduction of Array

Which method compares elements by elements in a serial fashion?

A Random search
B Linear search
C Both A and B
D None of the given
MCQ 134 Introduction of Array

Which method is used to set the value of the field constants of calendar class?

A Get
B get
C Set
D set
MCQ 135 Introduction of Array

Which of the following action will be performed with command java.util.Arrays.fill(list, 5)?

A The first five elements of array will be displayed
B Value 5 will be assigned to all elements of list array.
C Value 0 will be assigned in the 5th element of list array.
D None of the given
MCQ 136 Introduction of Array

Which of the following statement is invalid for declaring an array with name height?

A int height [ ]= new int[7]
B int[] height = new int[7]
C int height[] = int [7]
D None of the given
MCQ 137 Introduction of Array

The length property returns______________ for 2D array.

A number of rows
B number of columns
C number of elements
D number of memory bytes
MCQ 138 Introduction of Array

What does 5 indicate in marks [5]?

A Total elements
B Value of an element
C Memory locations occupied by the variable
D Subscript/index of an element
MCQ 139 Introduction of Array

Which method returns a string with all characters of invoking string converted to lowercase?

A String toLowerCase()
B String toLower()
C Lowercase()
D All of the given
MCQ 140 Introduction of Array

Which of the following statement is true for an array int marks [][] = new int[5] [3]:?

A Logical view of array elements is a table of 5 rows and 3 columns.
B Physically, array elements are stored in memory using contiguous memory location for 15 integers.
C This array occupies 60 bytes in memory.
D All of the given
MCQ 141 Introduction of Array

Which of the following class handles string in Java?

A string
B stringBuffer
C Both A and B
D None of the given
MCQ 142 Introduction of Array

In Java, length is a _____________ with string object.

A method
B attribute
C property
D All of the given
MCQ 143 Introduction of Array

When an array element is searched using binarysearch() method, __________ value is returned if an element is not found.

A 1
B -1
C 0
D error message
MCQ 144 Introduction of Array

Which of the following statement is true for an array int marks[]=new int[3]?

A It is an array to store three integer values.
B The name of an array is marks.
C The array will occupy 6 bytes in memory.
D Both A and
MCQ 145 Introduction of Array

Which of the following will be displayed when invoking string is same as object Str?

A Returns error message
B Returns wrong message
C Returns false
D Returns true
MCQ 146 Introduction of Array

Which of the following statement is invalid for declaring an array with name height?

A int height [ ] = new int[7]
B int [ ] height = new int[7]
C int height [ ] = int [7]
D None of the given
MCQ 147 Introduction of Array

In which of the following braces, the subscript of an array is enclosed?

A [ ]
B ( )
C { }
D <>
MCQ 148 Introduction of Array

What will be stored in an array marks [2] if int marks[]= (10, 20, 30, 40, 50)?

A 10
B 20
C 30
D 40
MCQ 149 Introduction of Array

Which method returns a string with all characters of invoking string converted lowercase?

A String toLowerCase()
B String toLower()
C Lowercase()
D All of the given to
MCQ 150 Introduction of Array

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 search for a specified element in array
D All of the given
MCQ 151 Introduction of Array

Vector array can be used to store list of items like_________

A characters
B numbers
C A or B
D All of the given
MCQ 152 Introduction of Array

__________________ method returns character at index position from the invoking string, Here index is considered from 0.

A byte getbyte ()
B char indexAt (int index)
C void getchars (int fromIndx, int toIndx, char target [], int targetIndx)
D string concat (string str)
MCQ 153 Introduction of Array

When an array element is searched using binarySearch () methods, which value is returned if an element is found?

A 1
B -1
C 0
D Index position
MCQ 154 Introduction of Array

Which of the following syntax is valid for declaring an array?

A int marks[] = int[15]:
B int marks[] = new int [15]:
C Both A and B
D None of the given
MCQ 155 Introduction of Array

Which value will be returned if invoking string is equal to str?

A 0
B 1
C -1
D None of the given
MCQ 156 Introduction of Array

Which of the following is displayed in the pair of square brackets "[ ]" that are used with array name?

A Index
B Subscript
C Size of an array
D All of the given
MCQ 157 Introduction of Array

What does array height [1] indicate?

A The first element of height array
B The second element of height array
C The value of variable height is 1
D All of the given
MCQ 158 Introduction of Array

Which of the following library provides Date class in Java?

A java.util
B java.utilities
C Java.date
D Java.char
MCQ 159 Introduction of Array

How many numbers of dimensions can be used to create a two-dimensional array?

A [10] [10]
B [3] [3]
C [256] [256]
D There is no limit.
MCQ 160 Introduction of Array

Which of the following constant of calendar class displays how in 12 hour notation?

A HOUR
B HOUR12
C 12HOUR
D HOUR 12
MCQ 161 Introduction of Array

In Java 2-D array, each row is considered as ___________________

A 1D array element
B dimension
C column
D None of the given
MCQ 162 Introduction of Array

77. In Java, to save the space, an array of ________________ should be used instead of an array of characters if the characters are ASCII.

A string
B bytes
C 3-D
D None of the given
MCQ 163 Introduction of Array

In which form the 2-D array stores data?

A Row and column form
B Tabular form
C A or B
D None of the given
MCQ 164 Introduction of Array

Which method is used to fill the whole or partial array with specified value?

A add
B fill
C insert
D None of the given
MCQ 165 Introduction of Array

Which method is used to get the number of characters in invoking string?

A int strlength( )
B int length( )
C int total( )
D int count( )
MCQ 166 Introduction of Array

Which sign is used to enclose the string in Java?

A โ€™ โ€˜
B " โ€œ
C # #
D $ $
MCQ 167 Introduction of Array

An index or subscript of an array refers to which of the following?

A Value of variable
B The position of an element in an array
C A or B
D None of the given
MCQ 168 Introduction of Array

Which braces are used to initialize values to the elements of a single dimensional array?

A { }
B [ ]
C < >
D ( )
MCQ 169 Introduction of Array

Which of the following method construct Date object using current system time?

A Date & Time ( )
B Date{ }
C Date( )
D Now( )
MCQ 170 Introduction of Array

Arrays are useful to represent_____________ data.

A vector
B matrix
C multi-dimensional
D All of the given
MCQ 171 Introduction of Array

With an array variable length is _______________________ of array.

A method
B an attribute
C property
D B or C
MCQ 172 Introduction of Array

Which method is used to set the value of the field constants of calendar class?

A Get
B get
C Set
D set
MCQ 173 Introduction of Array

How many values will be stored in the memory of an array int height][]=new int [4] [3]; ?

A 4
B 12
C 3
D 7
MCQ 174 Introduction of Array

Which type of data can be presented using an array in Java?

A Vector
B Matrix
C Multi-dimensional
D All of the given
MCQ 175 Introduction of Array

Which constructor in Java creates a string object which is same as object specified in argument?

A String()
B String(String literal)
C String(String Strobj)
D None of the given
MCQ 176 Introduction of Array

How many bytes will be occupied in a memory by an array int marks! ]= new int[3]?

A 3
B 6
C 12
D 18
MCQ 177 Introduction of Array

Which of the following property is used to get the number of elements in 1-D array?

A length
B size
C number
D total
MCQ 178 Introduction of Array

How many elements of an array will be sorted by method java.util.Arrays.sort(list 1, 5)?

A list[1] and list[5]
B From list[1] to list[5]
C From list[1] to list[5-1]
D From list[0] to list[5-1]
MCQ 179 Introduction of Array

Which package of Java library provides calendar class?

A java.cal
B java.lib.cal
C Java.util
D java.util.cal
MCQ 180 Introduction of Array

In Java array, ____________ are used while using length method with string object.

A [ ]
B ( )
C { }
D <>
MCQ 181 Introduction of Array

When two string objects are created using the same string literals ______________

A memory space is not allocated for second object.
B both objects refers to same memory location.
C Both A and B
D both objects are allocated separate memory space.
MCQ 182 Introduction of Array

_________________ method returns true, if invoking string is same as str.

A boolean equals (string str)
B boolean equalsIgnoreCase (string str)
C int compareTo (string str)
D int compareTolgnoreCase (string str)
MCQ 183 Introduction of Array

Whose size is indicated by the first square bracket in the statement: int height [ ][ ] = new int [6] [4]?

A Memory
B Cell
C Column
D Row
MCQ 184 Introduction of Array

In which of the following braces, the subscript of an array is enclosed?

A ( )
B { }
C [ ]
D < >
MCQ 185 Introduction of Array

_________________ method in Java returns an array of characters as bytes from invoking string.

A byte[ ] getBytes( )
B getBytes( )
C setByte[ ]
D byte[ ]
MCQ 186 Introduction of Array

With which number an index value start in an array?

A 1
B -1
C 0
D None of the given
MCQ 187 Introduction of Array

___________constructor in Java create a string object with no character.

A String( )
B String(null)
C String(char ary[ ])
D All of the given
MCQ 188 Introduction of Array

Which method is used to fill the whole or partial array with specified value?

A add
B Insert
C fill
D All of the given
MCQ 189 Introduction of Array

Which of the following constructor creates a string object with its initial value using ary argument?

A string (string)
B string (string string)
C string (int string)
D string (char ary[ ])
MCQ 190 Introduction of Array

In Java, separate memory is allocated when string objects are created using operator even if strings are identical.

A literal
B new
C str
D constructor
MCQ 191 Introduction of Array

______________ method returns character at index position from the invoking string index is considered from 0.

A int length()
B char indexAt (int index)
C byte getBytes()
D string toLowerCase()
MCQ 192 Introduction of Array

String class in Java does not provide method for ____________________

A reversing strings
B obtaining substring
C converting strings
D appending string
MCQ 193 Strings

In java,how many bytes are used to store charactres ?

A 1
B 3
C 2
D 4
MCQ 194 Strings class methods

In string class,which of the following method is used to return a string after appending str with the invoking string ?

A String Add(String str)
B String Concat(String str)
C String toLowerCase( )
D String Append(String str)
MCQ 195 Strings class methods

Which operator is used, when string objects have Separate allocated memory and are identical?

A literal
B new
C create
D (A)and(B)both
MCQ 196 Date Class

In date class, which method is used to construct date object using specify time in milliseconds elapsed since January 1, 1970 GMT?

A Date()
B Long getTime()
C Date ( long elapsedTime )ร‚ย 
D String toString()
MCQ 197 Introduction of Array

In java, which of the following is an object used to mange list of items?

A Array
B Form
C Window
D Document
MCQ 198 Introduction of Array

Which of the following is a variable representing a collection of homogeneous type of elements?

A Array
B Method
C Class
D Object
MCQ 199 Calender class

Which constant of Calendar class set day number in the year (1 for the first day)?

A DAY.OF.YEAR
B DAY_OF_YEAR
C day-of-year
D dayofyear
MCQ 200 Introduction of Array

In Java, which constant of calender class will display day number in the year?

A DAY OF YEAR
B DAY
C DAY_OF_MONTH
D DAY OF WEEK
MCQ 201 Introduction of Array

In Java, which property of 1-D array is used to know size of each row?

A size
B length
C sort
D fill
MCQ 202 Introduction of Array

In Java, how many integer values can be stored using following array? int marks [] [] = new int [4] [4]; .

A 4
B 8
C 16
D 64
MCQ 203 Introduction of Array

Which of the following methods of string class of Java returns true if invoking string is same as str after ignoring case?

A boolean equals ignore case (string str)
B int compare To (string str)
C boolean equals (string str)
D int length()
MCQ 204 Introduction of Array

In Java, how many arguments are required to fill partial array?

A 2
B 3
C 4
D 5
MCQ 205 Introduction of Array

Which kind of variables are of basic data types and can store only one value at a time?

A Array variables
B 1-D variables
C 2-D variables
D Scalar variables
MCQ 206 Introduction of Array

In Java which method of date class returns number of milliseconds since January1, 1970 GMT?

A Date (long elapsedTime)
B long getTime ( )
C Date ( )
D void setTime (long elapsedTime)
MCQ 207 Introduction of Array

Which of the following is a one-dimensional data structure that can be used to store list of items like characters, numbers?

A vector
B matrix
C row
D column
MCQ 208 Introduction of Array

Which of the following methods does element by element comparison in a serial fashion?

A Binary Search ( )
B Linear Search
C Random Search
D Numerical Search
MCQ 209 Introduction of Array

In Java, what is the size of row in following array? int marks [ ] [ ] = new int [4] [3);

A 3
B 12
C 7
D 4
MCQ 210 Introduction of Array

In 1-D array of Java, which of the following symbols is used to separate elements in a pair of { } braces?

A Comma
B Plus
C Underscore
D Space
MCQ 211 Introduction of Array

In Java, which of the following are useful when same operations are to be performed on various elements of the similar type?

A Arrays
B Variables
C Characters
D String
MCQ 212 Introduction of Array

How many arguments are required to fill partial array in Java?

A 3
B 4
C 2
D 1
MCQ 213 Introduction of Array

In Java, which of the following classes contains methods like sort ( ) and fill ( )?

A java.lang
B Arrays.java
C java.util.Arrays
D util.Arrays
MCQ 214 Introduction of Array

In 1-D array of Java, which property is used to know size of each row?

A size
B float
C length
D width
MCQ 215 Introduction of Array

What will be the value of the element J [2] in the following array in Java? int J [ ] = {70, 31, 10, 45, 50};

A 31
B 2
C 10
D J [2]
MCQ 216 Date Class

In java library,which of the following packagesย is used to provid Date class and Calender class ?

A java.util
B java.util.Arrays
C java.io
D java.lang
MCQ 217 Strings class methods

which object is using length method?

A Array
B String
C Date
D Calendarย 
MCQ 218 Strings class methods

What will be the output of given java program? { String str1="india"; String str2="INDIA"; System.out.println(str1.compartTo(str2)); }

A 0
B &gt;0
C 32
D -32
MCQ 219 Strings class methods

IN JAVA,IF STR IS THE OBJECT OF STRING CLASS AND ITS CONTENT IS "HELLO" THEN WHAT IS THE VALUE OF STR.LENGTH().

A 8
B 7
C 6
D 5
MCQ 220 2-D Array

WHAT IS THE SIZE OF SECOND DIMENSION IN AN ARRAY SALES? sales[5][12]

A 12
B 5
C 60
D 11
MCQ 221 Calender class

Which constant of Calendar class set day number in the year (1 for the first day)?

A DAY.OF.YEAR
B DAY_OF_YEAR
C day-of-year
D dayofyear
MCQ 222 Introduction of Array

In Java, which of the following methods calls sort elements of array โ€˜listโ€™ from list [1] to list [5-1] ?

A sort (list)
B java.sort (list)
C java.util.Arrays.sort (list, 1, 5)
D java.util.sort (list, 5)
MCQ 223 Introduction of Array

In Java, which of the following is a proper example of initializing 1-D array? (i) int marks [3]= {90,100,110}; (i) int marks[] = {90,100,110}; (iii) int[] marks = {90,100,110};

A only (i)
B (i) and (ii)
C (i) and (iii)
D (ii) and (iii)
MCQ 224 Introduction of Array

Which of the following constructors can create a string object with its initial value using โ€˜aryโ€™ argument?

A string ( )
B string (string strobj)
C string (string literal)
D string (char ary[ ])
MCQ 225 Introduction of Array

In 1-D array of Java, which property is used to know size of each row?

A size
B float
C length
D width
MCQ 226 Introduction of Array

Which of the following is the correct syntax to declare Array in Java?

A &lt; array name&gt;[ ]&lt; data type&gt;;
B &lt; array name&gt; &lt; data type&gt; [ ];
C &lt; array name&gt; &lt; class name&gt;[];
D &lt; data type&gt; &lt; array name&gt; [ ] ;
MCQ 227 Introduction of Array

Which sign is used to enclose the string in Java?

A โ€™ โ€˜
B " โ€œ
C # #
D $ $
MCQ 228 Introduction of Array

Which type of data can be presented using an array in Java?

A Vector
B Matrix
C Multi-dimensional
D All of the given
MCQ 229 Introduction of Array

With which number an index value start in an array?

A 1
B -1
C 0
D None of the given
MCQ 230 Strings class methods

In string class,which of the following method is used to return a string after appending str with the invoking string ?

A String Add(String str)
B String Concat(String str)
C String toLowerCase( )
D String Append(String str)
MCQ 231 Strings class methods

Which operator is used, when string objects have Separate allocated memory and are identical?

A literal
B new
C create
D (A)and(B)both
MCQ 232 Date Class

In date class, which method is used to construct date object using specify time in milliseconds elapsed since January 1, 1970 GMT?

A Date()
B Long getTime()
C Date ( long elapsedTime )ร‚ย 
D String toString()
MCQ 233 Introduction of Array

In Java, which constant of calender class will display day number in the year?

A DAY OF YEAR
B DAY
C DAY_OF_MONTH
D DAY OF WEEK
MCQ 234 Introduction of Array

In Java, how many integer values can be stored using following array? int marks [] [] = new int [4] [4]; .

A 4
B 8
C 16
D 64
MCQ 235 Introduction of Array

Which of the following methods of string class of Java returns true if invoking string is same as str after ignoring case?

A boolean equals ignore case (string str)
B int compare To (string str)
C boolean equals (string str)
D int length()
MCQ 236 Introduction of Array

Which kind of variables are of basic data types and can store only one value at a time?

A Array variables
B 1-D variables
C 2-D variables
D Scalar variables
MCQ 237 Introduction of Array

In Java which method of date class returns number of milliseconds since January1, 1970 GMT?

A Date (long elapsedTime)
B long getTime ( )
C Date ( )
D void setTime (long elapsedTime)
MCQ 238 Introduction of Array

Which of the following is a one-dimensional data structure that can be used to store list of items like characters, numbers?

A vector
B matrix
C row
D column
MCQ 239 Introduction of Array

Which of the following methods does element by element comparison in a serial fashion?

A Binary Search ( )
B Linear Search
C Random Search
D Numerical Search
MCQ 240 Introduction of Array

In Java, which of the following are useful when same operations are to be performed on various elements of the similar type?

A Arrays
B Variables
C Characters
D String
MCQ 241 Introduction of Array

How many arguments are required to fill partial array in Java?

A 3
B 4
C 2
D 1
MCQ 242 Introduction of Array

In Java, which of the following classes contains methods like sort ( ) and fill ( )?

A java.lang
B Arrays.java
C java.util.Arrays
D util.Arrays
MCQ 243 Introduction of Array

What will be the value of the element J [2] in the following array in Java? int J [ ] = {70, 31, 10, 45, 50};

A 31
B 2
C 10
D J [2]
MCQ 244 Introduction of Array

In java, which of the following is an object used to mange list of items?

A Array
B Form
C Window
D Document
MCQ 245 Strings

WHICH STRING CONSTRUCTOR IS USED WITHOUT ARGUMENT TO CREATE A STRING OBJECT WITH NO CHARACTERS.

A STRING()
B STRING (CHAR ARY [])
C STRING (SSO)
D STRING (STR LITERAL)
MCQ 246 1-D Array

IN JAVA, TO SEARCH AN ELEMENT IN AN ARRAY, ARRAY CLASS PROVIDES WHICH TYPE OF METHOD.

A FILL()
B BINARYSEARCH()
C SORT()
D REMOVE()
MCQ 247 1-D Array

WHICH TYPE OF BRACE IS USED TO INITIALIZE DATA ELEMENT IN 1-D ARRAY.

A &lt;&gt;
B []
C {}
D ()
MCQ 248 Strings class methods

IN JAVA,IF STR IS THE OBJECT OF STRING CLASS AND ITS CONTENT IS "HELLO" THEN WHAT IS THE VALUE OF STR.LENGTH().

A 8
B 7
C 6
D 5
MCQ 249 2-D Array

WE CAN USE VARIOUS STATIC METHODS PROVIDED BY JAVA USING WHICH ARRAY CLASS.

A JAVA.UTIL.ARRAYS
B JAVA.JO
C JAVA.LANG
D ALL OF THESE
MCQ 250 Date Class

WHICH METHOD OF DATE CLASS CONSTRUCTS DATE OBJECT USING CURRENT SYSTEM TIME IN JAVA?

A DATE &amp; TIME()
B TODAYS DATE()
C DATE()
D NOW()
MCQ 251 Introduction of Array

ARRAYS ARE USEFUL TO REPRESENT WHICH TYPE OF DATA IN JAVA?

A VECTOR
B MATRIX
C MULTI
D ALL OF THESE
MCQ 252 Introduction of Array

An array object can be created in how many ways?

A Using new operator and specifying the size
B Directly initializing the content of array
C Specify the size
D Both a and b
MCQ 253 Introduction of Array

Declaring an array without โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ..does not create an array object.

A initialization
B Declaration
C Instantiation
D None of these
MCQ 254 Introduction of Array

In Java, int compareto(String str) method returns which value if invoking string is equal to str?

A 0 zero
B > 0
C <0
D -1
MCQ 255 Introduction of Array

In Java, which constant of calender class will display day number in the year?

A DAY OF YEAR
B DAY
C DAY_OF_MONTH
D DAY OF WEEK
MCQ 256 Introduction of Array

In Java, which of the following classes contains methods like sort ( ) and fill ( )?

A java.lang
B Arrays.java
C java.util.Arrays
D util.Arrays
MCQ 257 Introduction of Array

In Java 2-D array, each row is considered as ___________________

A 1D array element
B dimension
C column
D None of the given
MCQ 258 Introduction of Array

Arrays are useful to represent_____________ data.

A vector
B matrix
C multi-dimensional
D All of the given
MCQ 259 Introduction of Array

In Java, which property of 1-D array is used to know size of each row?

A size
B length
C sort
D fill
MCQ 260 Introduction of Array

In 1-D array of Java, which of the following symbols is used to separate elements in a pair of { } braces?

A Comma
B Plus
C Underscore
D Space
MCQ 261 Introduction of Array

How many arguments are required to fill partial array in Java?

A 3
B 4
C 2
D 1
MCQ 262 Strings class methods

Which operator is used, when string objects have Separate allocated memory and are identical?

A literal
B new
C create
D (A)and(B)both