SlideShare a Scribd company logo
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
1 2 3 .... 10000
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
1. What do we call the basic data type which can store only one value at a time?
a) Local variable
b) Scalar variable
c) Static variable
d) Instance variable
2. What do we call the data type that can be used to store a collection of more than
one data values?
a) Scalar variable
b) Constructor
c) Basic variable
d) Composite variable
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
3. Which kind of variable is a variable representing a collection of homogeneous type
of elements?
a) Array
b) Global
c) Instance
d) Local
4. What is useful when same operations are to be performed on various elements of
the similar type in Java ?
a) String
b) Array
c) If ... Then
d) While
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
5. Arrays are useful to represent which type of data in Java ?
a) Vector
b) Matrix
c) Multi dimensional
d) All of these
6. Which of the following are useful to represent vector, matrix and other multi -
dimensional data ?
a) Variable
b) Element
c) Tag
d) Array
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
7. Java does not support ............. type of an array.
a) 1 D
b) 2 D
c) Multi – dimensional
d) Both b and c
8. ................. is a 1D data structure that can be used to store list of items like
character, numbers in Java.
a) Matrix
b) Vector
c) Composite
d) Static
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
9. .............. is used to represent 2 – D data structure like table of rows and columns.
a) Matrix
b) Vector
c) Composite
d) Static
10. Which type of array is used like table of rows and columns ?
a) Primitive array
b) Minor array
c) 1- D array
d) 2- D array
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
11. How do we identify each element of array?
a) By a pointer
b) By an index position
c) By memory allocation
d) All of these
12. An index position of an array is associated with array ..................
a) Method
b) Function
c) Variable
d) Class
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
13. What specifies the position of an element in an array ?
a) Serial
b) Index
c) Number
d) Class
14. Which of the following refer to the starting index value in arrays?
a) 1
b) 0
c) Null
d) All of these
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
15. What is the process of making an object used to manage list of items in array?
a) Declare an array object
b) Create an array object
c) Both (a) and (b)
d) Define object method
16. An array object can be created in how many ways ?
a) Directly initializing the content of array
b) Specify the size
c) Using new operator and specifying the size
d) Both a and c
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
1 D Array
Single Dimension Array
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
17. Which of the following syntax is used to declare array in java ?
a) <data type>[ ] < array name>[];
b) <data type><array name> [ ];
c) Both (a) and (b)
d) None of these
18. Declaring an array without ......... does not create an array object.
a) Declaration
b) Initialization
c) Instantiation
d) None of these
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
19. In java, initial value of array elements are specified into what brackets ? OR Which
type of braces is used to initialize data elements in 1-D array?
a) ()
b) {}
c) []
d) <>
20. In java, initial value for 1 – D array are separated using which symbol? OR In java,
by using which sign 1-D array is initialized to separate values of data elements in
braces() ?
a) – (dash)
b) : (colon)
c) ,(comma)
d) .(full stop)
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
21. Which of the following an example of data element of array?
a) int marks[ ]={50,60,70};
b) int marks[3]={50,60,70};
c) int marks[ ]=(50,60,70);
d) int marks[ ]={50;60;70};
22. Size of each row can be known using ..... property of 1 – D array.
a) Size
b) Length
c) Width
d) Row
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
23. In java, how can be array elements accessed using index for each dimension in?
a) ()
b) {}
c) []
d) <>
24. If ‘int marks[]={1,2,3,4,5};’ is defined in java what will be the value of marks[3] ?
a) 3
b) 2
c) 4
d) 5
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
25. In java, we can not specify both the size of ....... and ....... values of the array
elements simultaneously while declaring an array.
a) Class & Variable
b) Dimensions & Length
c) Initial & Value
d) Dimensions and Initial
26. 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[3]={50, 60, 70}
c) int[] marks=new int[3]
d) None of these
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
27. How many bytes are used to store the int marks[] = new int [5] array ?
a) 5 X 1 = 5
b) 5 X 2 = 10
c) 5 X 4 = 20
d) 5 X 8 = 40
28. Sort and fill() are methods of which of the following java class? OR We can use
various static methods provided by Java using which array class?
a) java.util.io
b) java.util.Arrays
c) java.io.Arrays
d) java.lang.Arrays
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
29. Which type of method is used to sort entire or part of array in java ?
a) fill()
b) sort()
c) show()
d) search()
30. In java, which method is used to fill the whole or partial array with specified value?
OR Which method of java.util.Arrays class is used to fill the whole or partial array
with specified value ?
a) sort()
b) set()
c) insert()
d) fill()
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
31. If you want to assigns value 7 to all elements of list array then which method is
used?
a) fill (ls,7)
b) fill(list, 7)
c) sort(list, 7)
d) fill(7)
32. What will done with command “fill (list, 2,6, 5);”?
a) Assigns array list value 5 to element list [5] 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 [2] to list[6 – 1]
d) None of these
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
33. In java, to search an element in an array, array class provides which type of
method?
a) sort()
b) fill()
c) binarySearch()
d) remove()
34. Which method in java, is used to search element by element comparison in a
serial fashion ?
a) Linear search
b) Find
c) Binary search
d) Look
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
2 D Array
Two Dimensional Arrays
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
35. 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) Index view
b) Display view
c) Logical view
d) Physically view
36. In java, which view of array is stored in memory using contiguous memory?
a) Index view
a) Display view
b) Logical view
c) Physically view
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
37. Which braces is used in 2 D array using comma separated values of data elements ?
a) [] (square bracket)
b) () (simple bracket)
c) <> (angled bracket)
d) {} (curly bracket)
38. In the following statement for declaring two dimensional array of java 5 represent
what?
int marks[][]=new int[5][3];
a) Array size
b) Number of columns
c) Number of rows
d) Number of bytes
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
39. What is the size of second dimension in an array sale [5][12] ?
a) 5
b) 10
c) 12
d) 60
40. What is the size of second dimension in an array gseb [5] [3] ?
a) 3
b) 5
c) 15
d) 18
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
41. Which property is used with only array name returns the size of its first
dimension in java?
a) Byte
b) Length
c) Width
d) Size
42. How many integer values will be stored in the following array ?
int marks[][]=new int[4][4];?
a) 4
b) 8
c) 16
d) 644
2.
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
43. What expression sales. length return for an array sales[5][12] ?
a) 5
b) 10
c) 12
d) 60
44. When an array sales[5][12] is declared without specifying initial values, what is
the initial value of sales[0][0] ?
a) 0
b) Default value
c) 60
d) Compilation error
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
45. In statement “int marks [][]=new int [5][3]” occupy how many memory ?
a) 15 (5*3) integers that store 0 bytes
b) 15 (5*3) integers that store 60 (15*4) bytes
c) 15(5*3) integers that store 15 bytes
d) None of these
46. How many bytes of location are occupied by an array ‘b’ of int b[][]=new int[5][3];?
a) 3
b) 5
c) 15
d) 60
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
Strings
Sequence of characters
1-D array of
charactersś
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
47. 1-D array of characters can be considered as a…………….. OR
…….. is considered as a sequence of characters
a) Character
b) String
c) Integer
d) Long
48. In java, string literals, a sequence of characters is enclosed between which sign?
a) ‘ ‘(single quote)
b) “ “(double quotes)
c) <>
d) /*….*/
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
49. 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)
50. Which operator can be used to concatenate a string in java?
a) =
b) +
c) &
d) *
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
51. In statement “String str1=new String(“I love Computer Subject”);” what do we call
str1?
a) String object
b) String class
c) Character class
d) Reference variable
52. In statement “String str1=new String(“I love Computer Subject”);” what do we call
“I love Computer Subject”?
a) String object
b) String class
c) Character class
d) Reference variable
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
53. Which of the following constructor is used for without arguments create a string
object with no character?
a) String(String literal)
b) String()
c) String (char ary[])
d) String (String strobj)
54. Which type of constructor creates a string object with its initial values using array
argument?
a) String(String literal)
b) String (String strobj)
c) String (char ary[])
d) string()
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
55. To make a string object which of the following constructors is used to create a string
object using 1-D ary argument starting at ary[start] with len number of character?
a) String(char ary[], int start, int len)
b) String(int start, int length)
c) String(int length, int start)
d) String(char ary[], int len)
56. Which constructor creates a string object which is same as object specified in
argument?
a) String(String literal)
b) String (String strobj)
c) String (char ary[])
d) string()
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
57. Separate memory is allocated when string objects are created using ………..operator.
a) Public
b) Private
c) Static
d) New
58. When two String objects are created using same string literals, memory space is not
allocated for …………… object.
a) zero
b) First
c) second
d) None of these
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N
59. What happen when we create a String object str1 and str2 without using new
operator?
a) Only str2 refer to different memory location.
b) Only str1 refer to different memory location.
c) str1 and str2 refer to the same instance as created for str1.
d) Both str1 and str2 refer to different memory location.
60. What happen when we create a String object st1 and st2 using new operator?
a) Only str2 refer to different memory location.
b) Only str1 refer to different memory location.
c) str1 and str2 refer to the same instance as created for str1.
d) Both str1 and str2 refer to different memory location.
C
o
m
p
i
l
e
d
b
y
N
U
Z
H
A
T
M
E
M
O
N

More Related Content

PPTX
Java Swing
PPTX
Java string handling
PPTX
Std 12 Computer Chapter 2 Cascading Style Sheets and Javascript(Part 1 CSS)
PPTX
Std 12 Computer Chapter 7 Java Basics (Part 1)
PPTX
Basic Concepts of OOPs (Object Oriented Programming in Java)
PPT
C#.NET
PPTX
Java swing
PDF
Visual Basic 6.0
Java Swing
Java string handling
Std 12 Computer Chapter 2 Cascading Style Sheets and Javascript(Part 1 CSS)
Std 12 Computer Chapter 7 Java Basics (Part 1)
Basic Concepts of OOPs (Object Oriented Programming in Java)
C#.NET
Java swing
Visual Basic 6.0

What's hot (20)

PPTX
Static Members-Java.pptx
PPTX
Lab #2: Introduction to Javascript
PPT
Data types
PPT
C# Basics
PPTX
Applets in java
PPTX
Classes objects in java
PDF
UI controls in Android
PPTX
Android UI
PPTX
Java Array String
PPTX
Interfaces in java
PPSX
Introduction to .net framework
PPTX
jQuery
PDF
JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
PPTX
Validation Controls in asp.net
PPTX
class and objects
PPTX
Packages in java
PPTX
Main method in java
PPTX
Java 8 lambda
Static Members-Java.pptx
Lab #2: Introduction to Javascript
Data types
C# Basics
Applets in java
Classes objects in java
UI controls in Android
Android UI
Java Array String
Interfaces in java
Introduction to .net framework
jQuery
JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
Validation Controls in asp.net
class and objects
Packages in java
Main method in java
Java 8 lambda
Ad

Similar to Std 12 Computer Chapter 9 Working with Array and String in Java important MCQs (20)

PDF
Starting Out with Java Early Objects 6th Edition Gaddis Test Bank
DOCX
Comp 328 final guide
PPTX
6_Array.pptx
PPTX
Arrays in java.pptx
PDF
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
PDF
Java MCQ Important Questions and Answers
PPTX
Arrays in programming
DOCX
FSOFT - Test Java Exam
PPTX
Tophcjdjjdjsjssjjdkdkdkfkfkdfkdic-2.pptx
PPTX
Java Programming
PDF
ITI COPA Java MCQ important Questions and Answers
PDF
All based on Zybooks = AP Java with zylabsPlease answer all questi.pdf
PDF
Arrays Java
PDF
Java apptitude-questions-part-1
DOCX
The Java Learning Kit Chapter 6 – Arrays Copyrigh.docx
PPTX
Arrayuyfuyyugyrhuhuuuurhrfuhufujoppoopopopop
PPTX
javaArrays.pptx
PPTX
CH1 ARRAY (1).pptx
PPTX
the array, which stores a fixed-size sequential collection of elements of the...
PPTX
Std 12 computer chapter 8 classes and objects in java important MCQs
Starting Out with Java Early Objects 6th Edition Gaddis Test Bank
Comp 328 final guide
6_Array.pptx
Arrays in java.pptx
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
Java MCQ Important Questions and Answers
Arrays in programming
FSOFT - Test Java Exam
Tophcjdjjdjsjssjjdkdkdkfkfkdfkdic-2.pptx
Java Programming
ITI COPA Java MCQ important Questions and Answers
All based on Zybooks = AP Java with zylabsPlease answer all questi.pdf
Arrays Java
Java apptitude-questions-part-1
The Java Learning Kit Chapter 6 – Arrays Copyrigh.docx
Arrayuyfuyyugyrhuhuuuurhrfuhufujoppoopopopop
javaArrays.pptx
CH1 ARRAY (1).pptx
the array, which stores a fixed-size sequential collection of elements of the...
Std 12 computer chapter 8 classes and objects in java important MCQs
Ad

More from Nuzhat Memon (20)

PPTX
Std 10 chapter 11 data type, expression and operators important MCQs
PPTX
Std 10 Chapter 10 Introduction to C Language Important MCQs
PPTX
Std 12 chapter 7 Java Basics Important MCQs
PPTX
Std 12 Computer Chapter 6 object oriented concept important mcqs
PPTX
Std 12 computer chapter 6 object oriented concepts (part 1)
PPTX
Std 12 computer chapter 6 object oriented concepts (part 2)
PPTX
Std 12 computer java basics part 3 control structure
PPTX
Std 12 Computer Chapter 7 Java Basics (Part 2)
PPTX
Std 12 Computer Chapter 13 other useful free tools and services important MCQs
PPTX
Std 12 computer chapter 8 classes and object in java (part 2)
PPTX
Std 10 computer chapter 10 introduction to c language (part2)
PPTX
Std 10 computer chapter 10 introduction to c language (part1)
PPTX
Std 10 computer chapter 9 Problems and Problem Solving
PPTX
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 3: Masking to R...
PPTX
Chapter 5 Using Pictures in Synfig (Practical 2: Masking to hide area in synfig)
PPTX
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 1 Basics Opera...
PPTX
Std 11 Computer Chapter 4 Introduction to Layers (Part 3 Solving Textual Exe...
PPTX
Std 11 Computer Chapter 4 Introduction to Layers (Part 2 Practical :Rotation ...
PPTX
Std 11 Computer Chapter 4 Introduction to Layers
PPTX
Std 11 Computer Chapter 3 Creating Animation using Synfig (Part 3) [practica...
Std 10 chapter 11 data type, expression and operators important MCQs
Std 10 Chapter 10 Introduction to C Language Important MCQs
Std 12 chapter 7 Java Basics Important MCQs
Std 12 Computer Chapter 6 object oriented concept important mcqs
Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 2)
Std 12 computer java basics part 3 control structure
Std 12 Computer Chapter 7 Java Basics (Part 2)
Std 12 Computer Chapter 13 other useful free tools and services important MCQs
Std 12 computer chapter 8 classes and object in java (part 2)
Std 10 computer chapter 10 introduction to c language (part2)
Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 9 Problems and Problem Solving
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 3: Masking to R...
Chapter 5 Using Pictures in Synfig (Practical 2: Masking to hide area in synfig)
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 1 Basics Opera...
Std 11 Computer Chapter 4 Introduction to Layers (Part 3 Solving Textual Exe...
Std 11 Computer Chapter 4 Introduction to Layers (Part 2 Practical :Rotation ...
Std 11 Computer Chapter 4 Introduction to Layers
Std 11 Computer Chapter 3 Creating Animation using Synfig (Part 3) [practica...

Recently uploaded (20)

PPTX
vedic maths in python:unleasing ancient wisdom with modern code
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
PPTX
Onica Farming 24rsclub profitable farm business
PPTX
Congenital Hypothyroidism pptx
PPTX
Odoo 18 Sales_ Managing Quotation Validity
PDF
3.The-Rise-of-the-Marathas.pdfppt/pdf/8th class social science Exploring Soci...
PPTX
How to Manage Loyalty Points in Odoo 18 Sales
PPTX
How to Manage Starshipit in Odoo 18 - Odoo Slides
PDF
Module 3: Health Systems Tutorial Slides S2 2025
PPTX
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
PPTX
Software Engineering BSC DS UNIT 1 .pptx
PPTX
Presentation on Janskhiya sthirata kosh.
PPTX
Skill Development Program For Physiotherapy Students by SRY.pptx
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
PDF
5.Universal-Franchise-and-Indias-Electoral-System.pdfppt/pdf/8th class social...
PDF
Cell Biology Basics: Cell Theory, Structure, Types, and Organelles | BS Level...
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
PPTX
Cardiovascular Pharmacology for pharmacy students.pptx
vedic maths in python:unleasing ancient wisdom with modern code
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Onica Farming 24rsclub profitable farm business
Congenital Hypothyroidism pptx
Odoo 18 Sales_ Managing Quotation Validity
3.The-Rise-of-the-Marathas.pdfppt/pdf/8th class social science Exploring Soci...
How to Manage Loyalty Points in Odoo 18 Sales
How to Manage Starshipit in Odoo 18 - Odoo Slides
Module 3: Health Systems Tutorial Slides S2 2025
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
Software Engineering BSC DS UNIT 1 .pptx
Presentation on Janskhiya sthirata kosh.
Skill Development Program For Physiotherapy Students by SRY.pptx
Renaissance Architecture: A Journey from Faith to Humanism
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
5.Universal-Franchise-and-Indias-Electoral-System.pdfppt/pdf/8th class social...
Cell Biology Basics: Cell Theory, Structure, Types, and Organelles | BS Level...
102 student loan defaulters named and shamed – Is someone you know on the list?
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
Cardiovascular Pharmacology for pharmacy students.pptx

Std 12 Computer Chapter 9 Working with Array and String in Java important MCQs

  • 2. C o m p i l e d b y N U Z H A T M E M O N 1. What do we call the basic data type which can store only one value at a time? a) Local variable b) Scalar variable c) Static variable d) Instance variable 2. What do we call the data type that can be used to store a collection of more than one data values? a) Scalar variable b) Constructor c) Basic variable d) Composite variable
  • 3. C o m p i l e d b y N U Z H A T M E M O N 3. Which kind of variable is a variable representing a collection of homogeneous type of elements? a) Array b) Global c) Instance d) Local 4. What is useful when same operations are to be performed on various elements of the similar type in Java ? a) String b) Array c) If ... Then d) While
  • 4. C o m p i l e d b y N U Z H A T M E M O N 5. Arrays are useful to represent which type of data in Java ? a) Vector b) Matrix c) Multi dimensional d) All of these 6. Which of the following are useful to represent vector, matrix and other multi - dimensional data ? a) Variable b) Element c) Tag d) Array
  • 5. C o m p i l e d b y N U Z H A T M E M O N 7. Java does not support ............. type of an array. a) 1 D b) 2 D c) Multi – dimensional d) Both b and c 8. ................. is a 1D data structure that can be used to store list of items like character, numbers in Java. a) Matrix b) Vector c) Composite d) Static
  • 6. C o m p i l e d b y N U Z H A T M E M O N 9. .............. is used to represent 2 – D data structure like table of rows and columns. a) Matrix b) Vector c) Composite d) Static 10. Which type of array is used like table of rows and columns ? a) Primitive array b) Minor array c) 1- D array d) 2- D array
  • 7. C o m p i l e d b y N U Z H A T M E M O N 11. How do we identify each element of array? a) By a pointer b) By an index position c) By memory allocation d) All of these 12. An index position of an array is associated with array .................. a) Method b) Function c) Variable d) Class
  • 8. C o m p i l e d b y N U Z H A T M E M O N 13. What specifies the position of an element in an array ? a) Serial b) Index c) Number d) Class 14. Which of the following refer to the starting index value in arrays? a) 1 b) 0 c) Null d) All of these
  • 9. C o m p i l e d b y N U Z H A T M E M O N 15. What is the process of making an object used to manage list of items in array? a) Declare an array object b) Create an array object c) Both (a) and (b) d) Define object method 16. An array object can be created in how many ways ? a) Directly initializing the content of array b) Specify the size c) Using new operator and specifying the size d) Both a and c
  • 11. C o m p i l e d b y N U Z H A T M E M O N 17. Which of the following syntax is used to declare array in java ? a) <data type>[ ] < array name>[]; b) <data type><array name> [ ]; c) Both (a) and (b) d) None of these 18. Declaring an array without ......... does not create an array object. a) Declaration b) Initialization c) Instantiation d) None of these
  • 12. C o m p i l e d b y N U Z H A T M E M O N 19. In java, initial value of array elements are specified into what brackets ? OR Which type of braces is used to initialize data elements in 1-D array? a) () b) {} c) [] d) <> 20. In java, initial value for 1 – D array are separated using which symbol? OR In java, by using which sign 1-D array is initialized to separate values of data elements in braces() ? a) – (dash) b) : (colon) c) ,(comma) d) .(full stop)
  • 13. C o m p i l e d b y N U Z H A T M E M O N 21. Which of the following an example of data element of array? a) int marks[ ]={50,60,70}; b) int marks[3]={50,60,70}; c) int marks[ ]=(50,60,70); d) int marks[ ]={50;60;70}; 22. Size of each row can be known using ..... property of 1 – D array. a) Size b) Length c) Width d) Row
  • 14. C o m p i l e d b y N U Z H A T M E M O N 23. In java, how can be array elements accessed using index for each dimension in? a) () b) {} c) [] d) <> 24. If ‘int marks[]={1,2,3,4,5};’ is defined in java what will be the value of marks[3] ? a) 3 b) 2 c) 4 d) 5
  • 15. C o m p i l e d b y N U Z H A T M E M O N 25. In java, we can not specify both the size of ....... and ....... values of the array elements simultaneously while declaring an array. a) Class & Variable b) Dimensions & Length c) Initial & Value d) Dimensions and Initial 26. 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[3]={50, 60, 70} c) int[] marks=new int[3] d) None of these
  • 16. C o m p i l e d b y N U Z H A T M E M O N 27. How many bytes are used to store the int marks[] = new int [5] array ? a) 5 X 1 = 5 b) 5 X 2 = 10 c) 5 X 4 = 20 d) 5 X 8 = 40 28. Sort and fill() are methods of which of the following java class? OR We can use various static methods provided by Java using which array class? a) java.util.io b) java.util.Arrays c) java.io.Arrays d) java.lang.Arrays
  • 17. C o m p i l e d b y N U Z H A T M E M O N 29. Which type of method is used to sort entire or part of array in java ? a) fill() b) sort() c) show() d) search() 30. In java, which method is used to fill the whole or partial array with specified value? OR Which method of java.util.Arrays class is used to fill the whole or partial array with specified value ? a) sort() b) set() c) insert() d) fill()
  • 18. C o m p i l e d b y N U Z H A T M E M O N 31. If you want to assigns value 7 to all elements of list array then which method is used? a) fill (ls,7) b) fill(list, 7) c) sort(list, 7) d) fill(7) 32. What will done with command “fill (list, 2,6, 5);”? a) Assigns array list value 5 to element list [5] 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 [2] to list[6 – 1] d) None of these
  • 19. C o m p i l e d b y N U Z H A T M E M O N 33. In java, to search an element in an array, array class provides which type of method? a) sort() b) fill() c) binarySearch() d) remove() 34. Which method in java, is used to search element by element comparison in a serial fashion ? a) Linear search b) Find c) Binary search d) Look
  • 21. C o m p i l e d b y N U Z H A T M E M O N 35. 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) Index view b) Display view c) Logical view d) Physically view 36. In java, which view of array is stored in memory using contiguous memory? a) Index view a) Display view b) Logical view c) Physically view
  • 22. C o m p i l e d b y N U Z H A T M E M O N 37. Which braces is used in 2 D array using comma separated values of data elements ? a) [] (square bracket) b) () (simple bracket) c) <> (angled bracket) d) {} (curly bracket) 38. In the following statement for declaring two dimensional array of java 5 represent what? int marks[][]=new int[5][3]; a) Array size b) Number of columns c) Number of rows d) Number of bytes
  • 23. C o m p i l e d b y N U Z H A T M E M O N 39. What is the size of second dimension in an array sale [5][12] ? a) 5 b) 10 c) 12 d) 60 40. What is the size of second dimension in an array gseb [5] [3] ? a) 3 b) 5 c) 15 d) 18
  • 24. C o m p i l e d b y N U Z H A T M E M O N 41. Which property is used with only array name returns the size of its first dimension in java? a) Byte b) Length c) Width d) Size 42. How many integer values will be stored in the following array ? int marks[][]=new int[4][4];? a) 4 b) 8 c) 16 d) 644 2.
  • 25. C o m p i l e d b y N U Z H A T M E M O N 43. What expression sales. length return for an array sales[5][12] ? a) 5 b) 10 c) 12 d) 60 44. When an array sales[5][12] is declared without specifying initial values, what is the initial value of sales[0][0] ? a) 0 b) Default value c) 60 d) Compilation error
  • 26. C o m p i l e d b y N U Z H A T M E M O N 45. In statement “int marks [][]=new int [5][3]” occupy how many memory ? a) 15 (5*3) integers that store 0 bytes b) 15 (5*3) integers that store 60 (15*4) bytes c) 15(5*3) integers that store 15 bytes d) None of these 46. How many bytes of location are occupied by an array ‘b’ of int b[][]=new int[5][3];? a) 3 b) 5 c) 15 d) 60
  • 28. C o m p i l e d b y N U Z H A T M E M O N 47. 1-D array of characters can be considered as a…………….. OR …….. is considered as a sequence of characters a) Character b) String c) Integer d) Long 48. In java, string literals, a sequence of characters is enclosed between which sign? a) ‘ ‘(single quote) b) “ “(double quotes) c) <> d) /*….*/
  • 29. C o m p i l e d b y N U Z H A T M E M O N 49. 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) 50. Which operator can be used to concatenate a string in java? a) = b) + c) & d) *
  • 30. C o m p i l e d b y N U Z H A T M E M O N 51. In statement “String str1=new String(“I love Computer Subject”);” what do we call str1? a) String object b) String class c) Character class d) Reference variable 52. In statement “String str1=new String(“I love Computer Subject”);” what do we call “I love Computer Subject”? a) String object b) String class c) Character class d) Reference variable
  • 31. C o m p i l e d b y N U Z H A T M E M O N 53. Which of the following constructor is used for without arguments create a string object with no character? a) String(String literal) b) String() c) String (char ary[]) d) String (String strobj) 54. Which type of constructor creates a string object with its initial values using array argument? a) String(String literal) b) String (String strobj) c) String (char ary[]) d) string()
  • 32. C o m p i l e d b y N U Z H A T M E M O N 55. To make a string object which of the following constructors is used to create a string object using 1-D ary argument starting at ary[start] with len number of character? a) String(char ary[], int start, int len) b) String(int start, int length) c) String(int length, int start) d) String(char ary[], int len) 56. Which constructor creates a string object which is same as object specified in argument? a) String(String literal) b) String (String strobj) c) String (char ary[]) d) string()
  • 33. C o m p i l e d b y N U Z H A T M E M O N 57. Separate memory is allocated when string objects are created using ………..operator. a) Public b) Private c) Static d) New 58. When two String objects are created using same string literals, memory space is not allocated for …………… object. a) zero b) First c) second d) None of these
  • 34. C o m p i l e d b y N U Z H A T M E M O N 59. What happen when we create a String object str1 and str2 without using new operator? a) Only str2 refer to different memory location. b) Only str1 refer to different memory location. c) str1 and str2 refer to the same instance as created for str1. d) Both str1 and str2 refer to different memory location. 60. What happen when we create a String object st1 and st2 using new operator? a) Only str2 refer to different memory location. b) Only str1 refer to different memory location. c) str1 and str2 refer to the same instance as created for str1. d) Both str1 and str2 refer to different memory location.