CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set A

CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set A with answers available in Pdf for free download. The MCQ Questions for Class 12 Computer Science with answers have been prepared as per the latest 2021 syllabus, NCERT books and examination pattern suggested in Standard 12 by CBSE, NCERT and KVS. Multiple Choice Questions for important part of exams for Grade 12 Computer Science and if practiced properly can help you to get higher marks. Refer to more Chapter wise MCQs for NCERT Class 12 Computer Science and also download more latest study material for all subjects

Question: An_______is a variable representing a collection of homogeneous type of elements.

  • a) Arrangement
  • b) Array
  • c) Assortment
  • d) Group

Answer: Array


Question: ________are useful to represent vector, matrix and other multi-dimensional data.

  • a) Arrangements
  • b) Arrays
  • c) Assortments
  • d) Groups

Answer: Arrays


Question: ________is one dimensional (1-D) data structure that can be used to store list of items like characters, numbers.

  • a) Vector
  • b) Path
  • c) Matrix
  • d) Route

Answer: Vector


Question: ________is used to represent two dimensional (2-D) data structures like table or rows and columns.

  • a) Vector
  • b) Path
  • c) Matrix
  • d) Route

Answer: Matrix


Question: ________are useful when same operations are to be performed on various elements of the similar type.

  • a) Matrix's
  • b) Arrays
  • c) Dimensions
  • d) Groups

Answer: Arrays


Question: All the______of an array are stored in memory using contiguous storage space.

  • a) Index's
  • b) Values
  • c) Features
  • d) Elements

Answer: Elements


Question: Each element is identified by an______position associated with array variable.

  • a) Index
  • b) Value
  • c) Tabular
  • d) Element

Answer: Index


Question: In Java_______is an object used to manage list of items.

  • a) Array
  • b) Variable
  • c) Matrix
  • d) Element

Answer: Array


Question: Creating an array is a_______step process.

  • a) One
  • b) Two
  • c) Three
  • d) Four

Answer: Two


Question: An array object can be created in_____ways.

  • a) One
  • b) Two
  • c) Three
  • d) Four

Answer: Two


Question: Which is the way an array object can be created ?

  • a) Using new operator and specifying the size.
  • b) Directly initializing the content of array
  • c) Both (A) and (B)
  • d) None of these

Answer: Both (A) and (B)


Question: Array with______dimension is known as 1-D array.

  • a) Double
  • b) Triple
  • c) Both (A) and (B)
  • d) Single

Answer: Single


Question: For example_________can be seen as a collection of one or more scalar variables.

  • a) Vector
  • b) Path
  • c) Matrix
  • d) Variable

Answer: Vector


Question: Instead of declaring individual variables like marks 1, marks2, marks3, marks4, marks5; one can declare array_________

  • a) Marks [5]
  • b) Mark[5]
  • c) Marks[l-5]
  • d) All of these

Answer: Marks [5]


Question: Individual variable elements of an array marks [5] can be accessed as :

  • a) Marks[1], marks[2], marks[3], marks[4], marks [5].
  • b) Marks[-1], marks[1], marks[2], marks[3], marks [4].
  • c) Marks[0], marks[1], marks[2], marks[3], marks [4].
  • d) Marks[-1], marks[0], marks[1], marks[2], marks [3].

Answer: Marks[0], marks[1], marks[2], marks[3], marks [4].


Question: To declare a______array a pair of square brackets [ ] is used after array name or after data type.

  • a) 2-D
  • b) 1-D
  • c) 3-D
  • d) 4-D

Answer: 1-D


Question: The syntax to declare array is as follows________A) [ ]; (B) ; (C) both (A) and (B) (D) none of these

  • a)[ ];
  • b);
  • c) Both (A) and (B)
  • d) None of these

Answer: Both (A) and (B)


Question: For example, to store the marks obtained by a student in five tests in Mathematics subject, an array of______integer elements can be used.

  • a) Five
  • b) Six
  • c) Four
  • d) Seven

Answer: Five


Question: The array marks refers to______location where five integer values are stored.

  • a) Chip
  • b) Memory
  • c) Variable
  • d) Address

Answer: Memory


Question: Array object named 'marks' with size for 5 elements can be created as follows :

  • a) Int marks [ ] = new int [5];
  • b) Int[ ] marks = new int [5];
  • c) Both (A) and (B)
  • d) None of these

Answer: Both (A) and (B)


More Questions.......................................


Question: Integer of int data type uses________bytes storage space.

  • a) 2
  • b) 3
  • c) 4
  • d) 5

Answer: 4


Question: Thus array marks requires________bytes in contiguous locations in memory.

  • a) 5 x 4 = 20
  • b) 5 x 5 = 25
  • c) 5 x 3 = 15
  • d) 5 x 2 = 10

Answer: 5 x 4 = 20


Question: To refer an element of an array, an index or subscript is used in______after array variable name.

  • a) Curly bracket { }
  • b) Square bracket [ ]
  • c) Round bracket ()
  • d) None of these

Answer: Square bracket [ ]


Question: ______specifies the position of an element in an array.

  • a) Number
  • b) Index
  • c) Variable name
  • d) Element

Answer: Index


Question: Index value starts from_______

  • a) 5
  • b) 4
  • c) 1
  • d) 0

Answer: 0


Question: The array variable marks[5] has an index value from_______

  • a) 1 to 5
  • b) 0 to 4
  • c) 0 to 5
  • d) 1 to 4

Answer: 0 to 4


Question: In array variable marks [5], marks [0] refers to the_______element.

  • a) Last
  • b) Second
  • c) First
  • d) None of these

Answer: First


Question: In array variable marks [5], marks [4] refers to the_______element.

  • a) Last
  • b) Second
  • c) First
  • d) Fourth

Answer: Last


Question: An object is a_______to variable.

  • a) Position
  • b) Location
  • c) Address
  • d) Reference

Answer: Reference


Question: Array being an object in Java, array name is also a______variable.

  • a) Position
  • b) Location
  • c) Address
  • d) Reference

Answer: Reference

 

Question: Array name contains_______to memory location where the array elements are stored.

  • a) Position
  • b) Location
  • c) Address
  • d) Reference

Answer: Reference


Question: As array is an object, so its elements are initialized with_______values.

  • a) Default
  • b) Initial
  • c) Declared
  • d) Index

Answer: Default


Question: 1-D array is initialized using_______separated values of data elements in braces { }.

  • a) Semi colon
  • b) Comma
  • c) Colon
  • d) Full stop

Answer: Comma


Question: Which of the following is correct initialization of 1-D array ?

  • a) Int marks[ ] = {90, 70, 77};
  • b) Int [ ] marks = {90, 70, 77};
  • c) Int marks} ] = {90; 70; 77}
  • d) Both (A) and (B)

Answer: Both (A) and (B)


Question: When an array is initialized while creating, it does not need the use of_______operator.

  • a) New
  • b) New
  • c) Int
  • d) Float

Answer: New


Question: The array size is same as the number of values specified in________

  • a) Braces
  • b) Index
  • c) Default value
  • d) Initialization

Answer: Braces


Question: Class methods are declared as________and can be referred without any object in the class.

  • a) Private
  • b) Void
  • c) Package
  • d) Static

Answer: Static


Question: Every element of an array is an individual variable that can be referred by using_______

  • a) Index
  • b) Value
  • c) Tabular
  • d) Element

Answer: Index


Question: Like variables, to change the value of an element, an assignment statement can be used which refers a variable element on______side.

  • a) Right
  • b) Left
  • c) Middle
  • d) None of these

Answer: Left


Question: Instead of writing the code, various static methods provided by Java using_______class can be used.

  • a) Java.Arrays
  • b) Java.utility
  • c) Java.util.Arrays
  • d) All of these

Answer: Java.util.Arrays


Question: Methods sort() and fill() are part of______class.

  • a) JavaArrays
  • b) Java.util
  • c) Java.util.Arrays
  • d) All of these

Answer: Java.util.Arrays


Question: To sort an entire or part of array_______method can be used.

  • a) Sort()
  • b) Fill()
  • c) Display()
  • d) Order()

Answer: Sort()


Question: Method______is used to fill or partial array with specified value.

  • a) Sort()
  • b) Fill()
  • c) Display()
  • d) Order()

Answer: Fill()


Question: To search an element in an array, arrays class provides______method.

  • a) Search0
  • b) Find()
  • c) Binary search()
  • d) Bin search ()

Answer: Binary search()


Question: search method does element by element comparison in a serial manner.

  • a) Linear
  • b) Vertical
  • c) Horizontal
  • d) Vector

Answer: Linear


Question: ______arrays are used to store tabular data in the form of rows and columns.

  • a) 2-D
  • b) 1-D
  • c) 3-D
  • d) 4-D

Answer: 2-D


Question: In Java, 2-D array can be declared using array name and 2 pairs of______to specify the size of two dimensions row and column respectively.

  • a) Curly bracket { } { }
  • b) Square bracket [ ] [ ]
  • c) Round bracket () ( )
  • d) None of these

Answer: Square bracket [ ] [ ]


Question: int marks [ ] f ] = new int [5] [3], the logical view of array elements is a table of_________

  • a) 3 rows and 5 columns
  • b) 15 columns
  • c) 5 rows and 3 columns
  • d) 15 rows

Answer: 5 rows and 3 columns


Question: Int marks [ ] [] = new int [5] [3], will physically use contiguous memory locations that is_______bytes.

  • a) 15
  • b) 45
  • c) 60
  • d) 8

Answer: 60


Question: To create_______array, an array of an array has to be created.

  • a) 2-D
  • b) 1-D
  • c) 3-D
  • d) 4-D

Answer: 2-D


Question: Declaration and initialization of 2-D array is very similar to 1-D array except the number of

  • a) Sizes
  • b) Length
  • c) Index values
  • d) Dimensions

Answer: Dimensions


Question: In 2-D array, each row is considered as_______array element.

  • a) 2-D
  • b) 1-D
  • c) 3-D
  • d) 4-D

Answer: 1-D


Question: To initialize 2-D array, all these initialized rows are to be enclosed in curly braces {} separating them by______

  • a) Colon (:)
  • b) Comma (,)
  • c) Semi Colon (;)
  • d) Full stop (.)

Answer: Comma (,)


Question: In Java, 2-D array is considered as an_______of 1-D array.

  • a) Matrix
  • b) Array
  • c) Dimension
  • d) Group

Answer: Array


Question: In 2-D array, each name is stored in different row and all names have different number of______

  • a) Spaces
  • b) Groups
  • c) Characters
  • d) Columns

Answer: Characters


Question: Size of each row of an array can be known using_______property of 1-D array.

  • a) Length
  • b) Height
  • c) len
  • d) Size

Answer: Length


Question: For 2-D array_______property returns number of rows.

  • a) Length
  • b) Height
  • c) len
  • d) Size

Answer: Length


Question: For 1-D array______property returns number of columns in specified row element.

  • a) Length
  • b) Height
  • c) Len
  • d) Size

Answer: Length


Question: ________is a collection of homogeneous type of data.

  • a) Matrix
  • b) Array
  • c) Dimension
  • d) Group

Answer: Array


Question: ________elements can be accessed using index for each dimension in [ ].

  • a) Matrix
  • b) Array
  • c) Dimension
  • d) Group

Answer: Array

 

Question: Index value starts with_______

  • a) One
  • b) Two
  • c) Zero
  • d) Three

Answer: Zero


Question: Declaring an______without initialization does not create an array object.

  • a) Matrix
  • b) Array
  • c) Dimension
  • d) Group

Answer: Array


Question: String is nothing but a sequence of________

  • a) Spaces
  • b) Groups
  • c) Characters
  • d) Columns

Answer: Characters


Question: 1-D array of_______can be considered as a string.

  • a) Spaces
  • b) Groups
  • c) Characters
  • d) Columns

Answer: Characters


Question: ________literals are where a sequence of characters is enclosed between double quotes.

  • a) String
  • b) Character
  • c) Numerical
  • d) None of these

Answer: String


Question: To use variables that can store strings, Java supports_____types of strings.

  • a) One
  • b) Two
  • c) Three
  • d) Four

Answer: Two


Question: Strings in Java are handled by two classes namely 'String' and________

  • a) Strings
  • b) Characters
  • c) Buffer
  • d) StringBuffer

Answer: StringBuffer


Question: String ( ) without arguments create a________object with no character.

  • a) String
  • b) Character
  • c) Buffer
  • d) Code

Answer: String


Question: String (char ary[ ]) creates a String object with its initial value using ary_______

  • a) Value
  • b) Argument
  • c) Index
  • d) [ ]

Answer: Argument


Question: String (char ary[ ], int start, intlen) creates a String object using 1-D ary argument starting at ary[start] with________number of characters.

  • a) Length
  • b) Leng
  • c) Len
  • d) Limited

Answer: Len


Question: String (String strObj) creates a String object which is same as object specified in________

  • a) Value
  • b) Argument
  • c) Index
  • d) Square brackets [ ]

Answer: Argument


Question: String (string literal) creates a String_________which is same as object specified in argument.

  • a) Literal
  • b) obj
  • c) Object
  • d) Variable

Answer: Object


Question: String (string literal) creates a String object that refers to the______specified in argument.

  • a) Literal
  • b) Obj
  • c) Object
  • d) Variable

Answer: Literal


Question: In Java, characters are stored using_______bytes.

  • a) Four
  • b) Three
  • c) Two
  • d) Five

Answer: Two


Question: To save space, if the characters are_______an array of bytes should be used instead of array of characters.

  • a) ASCII
  • b) Coded
  • c) ACSII
  • d) ACIIS

Answer: ASCII


Question: A______can be used with array of bytes as an argument.

  • a) Method
  • b) Destructor
  • c) Variable
  • d) Constructor

Answer: Constructor


Question: When two String objects are created using same string literals, memory space is not allocated for______object.

  • a) First
  • b) Second
  • c) Both (A) and (B)
  • d) None of these

Answer: Second


Question: Separate memory is allocated when string objects are created using________operator even if strings are identical.

  • a) New
  • b) new
  • c) int
  • d) Float

Answer: new


Question: "strl = - str2"_______the contents of strl and str2 and not the objects at strl and str2.

  • a) Equals
  • b) Matches
  • c) Compares
  • d) Relates

Answer: Compares


Question: The String class provides_______to compare strings, find length of string, combining strings, obtaining substrings, converting strings, splitting strings, searching for character or patterns in string etc.

  • a) Constructors
  • b) Methods
  • c) Strings
  • d) Classes

Answer: Methods


Question: Method Boolean equals(String str) returns_______if invoking string is same as str.

  • a) True
  • b) False
  • c) Can't say
  • d) None of these

Answer: True


Question: Method booleanequalslgnore Case (String str) returns_______if invoking string is same as str after ignoring case (case insensitive).

  • a) True
  • b) False
  • c) Can't say
  • d) None of these

Answer: True


Question: Method int compare To (String str) returns 0, > 0, < 0_______if invoking string is equal to, greater than or less than str respectively.

  • a) String
  • b) Negative value
  • c) Integer
  • d) Float

Answer: Integer


Question: Method int compare To ignore Case (String str) is same as______but Case Sensitive.

  • a) Equals
  • b) Ignore Case
  • c) Equals lgnore Case
  • d) Compare To

Answer: Compare To


Question: A String class provides methods for_______task.

  • a) Extracting part of string.
  • b) Replacing characters or substrings.
  • c) Splitting string into substrings
  • d) All of these

Answer: All of these


Question: A String class provides methods for______task.

  • a) Getting number of characters.
  • b) Getting character at specified index position.
  • c) Converting string into an array of bytes.
  • d) All of these

Answer: All of these


Question: A String class provides methods for_____task.

  • a) Converting string into lowercase or uppercase
  • b) Appending string
  • c) Copy string or part of string
  • d) All of these

Answer: All of these


Question: Method int______returns number of characters in invoking string.

  • a) IndexAt(int index)
  • b) Length( )
  • c) GetBytes()
  • d) To Upper Case()

Answer: Length( )


Question: Method char______returns character at index position from the invoking string, index considered from 0.

  • a) Index At(int index)
  • b) Length( )
  • c) Get Bytes()
  • d) To Upper Case()

Answer: Index At(int index)


Question: Method byte[ ]_______returns an array of characters as bytes from invoking string.

  • a) IndexAt(int index)
  • b) Length( )
  • c) Get Bytes()
  • d) To Upper Case()

Answer: Get Bytes()

Tags: 

 


Click for more Computer Science Study Material
Cascading Style Sheets and JavaScript
CBSE Class 12 Computer Science Cascading Style Sheets and JavaScript MCQs Set A
CBSE Class 12 Computer Science Cascading Style Sheets and JavaScript MCQs Set B
CBSE Class 12 Computer Science Cascading Style Sheets and JavaScript MCQs Set C
CBSE Class 12 Computer Science Cascading Style Sheets and JavaScript MCQs Set D
Classes and Objects In Java
CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set A
CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set B
CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set C
CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set D
Creating HTML Forms Using KompoZer
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set A
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set B
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set C
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set D
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set E
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set F
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set G
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set H
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set I
Designing Simple Website Using Kompozer
CBSE Class 12 Computer Science Designing Simple Website Using Kompozer MCQs Set A
CBSE Class 12 Computer Science Designing Simple Website Using Kompozer MCQs Set B
CBSE Class 12 Computer Science Designing Simple Website Using Kompozer MCQs Set C
CBSE Class 12 Computer Science Designing Simple Website Using Kompozer MCQs Set D
Exception Handling In Java
CBSE Class 12 Computer Science Exception Handling In Java MCQs Set A
CBSE Class 12 Computer Science Exception Handling In Java MCQs Set B
CBSE Class 12 Computer Science Exception Handling In Java MCQs Set C
CBSE Class 12 Computer Science Exception Handling In Java MCQs Set D
File Handling
CBSE Class 12 Computer Science File Handling MCQs Set A
CBSE Class 12 Computer Science File Handling MCQs Set B
CBSE Class 12 Computer Science File Handling MCQs Set C
CBSE Class 12 Computer Science File Handling MCQs Set D
CBSE Class 12 Computer Science File Handling MCQs Set E
CBSE Class 12 Computer Science File Handling MCQs Set F
File System
CBSE Class 12 Computer Science File System MCQs Set A
CBSE Class 12 Computer Science File System MCQs Set B
CBSE Class 12 Computer Science File System MCQs Set C
CBSE Class 12 Computer Science File System MCQs Set D
CBSE Class 12 Computer Science File System MCQs Set E
CBSE Class 12 Computer Science File System MCQs Set F
Introduction To E Commerce
CBSE Class 12 Computer Science Introduction To E Commerce MCQs Set A
CBSE Class 12 Computer Science Introduction To E Commerce MCQs Set B
CBSE Class 12 Computer Science Introduction To E Commerce MCQs Set C
CBSE Class 12 Computer Science Introduction To E Commerce MCQs Set D
CBSE Class 12 Computer Science Introduction To E Commerce MCQs Set E
Introduction To M Commerce
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set A
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set B
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set C
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set D
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set E
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set F
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set G
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set H
Java Basics
CBSE Class 12 Computer Science Java Basics MCQs Set A
CBSE Class 12 Computer Science Java Basics MCQs Set B
CBSE Class 12 Computer Science Java Basics MCQs Set C
CBSE Class 12 Computer Science Java Basics MCQs Set D
CBSE Class 12 Computer Science Java Basics MCQs Set E
CBSE Class 12 Computer Science Java Basics MCQs Set F
CBSE Class 12 Computer Science Java Basics MCQs Set G
Object Oriented Concepts
CBSE Class 12 Computer Science Object Oriented Concepts MCQs Set A
CBSE Class 12 Computer Science Object Oriented Concepts MCQs Set B
CBSE Class 12 Computer Science Object Oriented Concepts MCQs Set C
CBSE Class 12 Computer Science Object Oriented Concepts MCQs Set D
CBSE Class 12 Computer Science Object Oriented Concepts MCQs Set E
Publishing Documents Using Latex
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set A
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set B
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set C
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set D
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set E
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set F
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set G
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set H

Latest NCERT & CBSE News

Read the latest news and announcements from NCERT and CBSE below. Important updates relating to your studies which will help you to keep yourself updated with latest happenings in school level education. Keep yourself updated with all latest news and also read articles from teachers which will help you to improve your studies, increase motivation level and promote faster learning

CBSE asks schools to load Class 12 Internal Assessment Marks

This has a reference to the letter no CBSE/COORD/2021 dated 11.02.2021 regarding conduct of the School-Based Assessment (Internal Assessment/Practical/ Project) of Class-XII and uploading the marks by 11.06.2021. It has been observed that some schools have not been...

Moderation of Marks Class 11 and 12 Board Exams

The portal for moderation and finalization of results for Class-12 is being opened from 16.07.2021 to 22.07.2021. As Board has to declare the result latest by 31.07.2021, schools have been requested to follow the schedule strictly and complete the moderation within...

FAQs on Policy for Tabulation of Marks for Class 10 Board Exams

ON POLICY Question.1 How CBSE will declare the result of Class-X? Answer. Results of Class X Board will be declared on the basis of an objective criterion developed by the Board vide Notification no.CBSE/CE/2021 dated 01.05.2021. Question.2. If any candidate is not...

CBSE Class 12 Evaluation Criteria 2021

SUMMARY OF THE POLICY FOR TABULATION OF MARKS FOR CLASS XII BOARD EXAMINATIONS 2021   1(a) Due to cancellation of the Board examinations, the assessment of theory portion of 80/70/60/50/30 marks will be done by the school based on the following:     Class...

CBSE Board Examination Scheme of Assessment 2021 2022

A. Academic session to be divided into 2 Terms with approximately 50% syllabus in each term: The syllabus for the Academic session 2021-22 will be divided into 2 terms by following a systematic approach by looking into the interconnectivity of concepts and topics by...

×
Studies Today