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 B 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: Method void________copies characters of invoking string fromlndx to tolndx-1 to target array from targetlndx onwards.

  • a) To Upper Case()
  • b) To Lower Case
  • c) Concat(String str)
  • d) Get Chars(intfromIndx, inttoIndx, char target [], inttargetIndx)

Answer: Get Chars(intfromIndx, inttoIndx, char target [], inttargetIndx)


Question: Method String______returns a string after appending str with the invoking string.

  • a) To Uppercase0
  • b) To LowerCase
  • c) Concat (String str)
  • d) Get Chars (intfromlndx, inttolndx, chad target[], inttargetlndx)

Answer: Concat (String str)


Question: String______returns a string with all characters of invoking string converted to lowercase.

  • a) To UpperCase()
  • b) To LowerCase
  • c) Concat (String str)
  • d) Get Chars (intfromlndx, inttolndx, chail target!], inttarget Indx)

Answer: To LowerCase


Question: String______returns a string with all characters of invoking string converted to uppercase.

  • a) To UpperCase()
  • b) To LowerCase
  • c) Concat (String str)
  • d) GetChars (intfromlndx, inttolndx, chJ target!], inttargetlndx)

Answer: To UpperCase()


Question: With array variable, length is an______or property of array;

  • a) Attribute
  • b) Method
  • c) String
  • d) None of these

Answer: Attribute


Question: With String object length is a_______

  • a) Attribute
  • b) Method
  • c) String
  • d) None of these

Answer: Method


Question: ________class of Java does not provide any method to reverse a string.

  • a) Attribute
  • b) Method
  • c) String
  • d) None of these

Answer: String


Question: Java library also provides class in java.util package.

  • a) Data
  • b) String
  • c) Time
  • d) Date

Answer: Date


Question: ________class encapsulates both date and time and represents the value using milliseconds precision.

  • a) Data
  • b) String
  • c) Time
  • d) Date

Answer: Date


Question: Method_______constructs Date object using current system time.

  • a) Date (long elapsed Time)
  • b) Date()
  • c) To String()
  • d) Get Time()

Answer: Date()


Question: Method______constructs Date object using specified time in milliseconds elapsed since January 1, 1970 GMT.

  • a) Date (long elapsed Time)
  • b) Date()
  • c) To String()
  • d) Get Time()

Answer: Date (long elapsed Time)


Question: Method String_______returns a string representing date and time of invoking object.

  • a) Date (long elapsed Time)
  • b) Date()
  • c) To String()
  • d) Get Time()

Answer: To String()


Question: Method long_____returns number of milliseconds since January 1,1970 GMT.

  • a) Date (long elapsed Time)
  • b) Date()
  • c) ToString()
  • d) Get Time()

Answer: Get Time()


Question: Method void set Time (long elapsed Time) sets new date and time of an object using elapsed time.

  • a) Set Time (long elapsed Time)
  • b) Date()
  • c) ToString()
  • d) Get Time()

Answer: Set Time (long elapsed Time)


Question: Like Date class______class is also provided in java.util package.

  • a) Data
  • b) Calendar
  • c) Time
  • d) Date

Answer: Calendar


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


Question: ______class can be used to extract calendar information like year, month, date, hour, minute and second.

  • a) Data
  • b) Calendar
  • c) Time
  • d) Date

Answer: Calendar


Question: Like get methods, set methods are used to set the value of the field constants of______class.

  • a) Data
  • b) Calendar
  • c) Time
  • d) Date

Answer: Calendar


Question: Execution of call 'calendar.set (Calendar.DATE, 20)' will set the date to________

  • a) Today's date
  • b) Yesterday's date
  • c) 20th
  • d) None of these

Answer: 20th


Question: _______the starting index of an array.

  • a) 0
  • b) 1
  • c) Null
  • d) All of these

Answer: 0


Question: Array elements are stored in_______

  • a) Sequential memory locations.
  • b) Scattered memory locations
  • c) Direct memory locations
  • d) Random memory locations

Answer: Sequential memory locations.


Question: Identify the incorrect declaration of arrays from the following.

  • a) Int a[50];
  • b) Float values[10] [20];
  • c) Double a[50];
  • d) Int score [10, 15];

Answer: Int score [10, 15];


Question: Array is used to represent the following.

  • a) A list of data items of different data types
  • b) A list of data items of real data type.
  • c) A list of data items of same data type..
  • d) A list of data items of integer data type

Answer: A list of data items of same data type..


Question: Array are passed to a function argument by_______

  • a) Value
  • b) Reference
  • c) Both value and reference
  • d) None of these

Answer: Reference


Question: An array a[8] will store how many values ?

  • a) 8
  • b) 7
  • c) 9
  • d) 0

Answer: 8


Question: If an array is declared as a a[10], then its elements will be stored as_______

  • a) a[l] to a[10]
  • b) a[l] to a[9]
  • c) a[0] to a[9]
  • d) a[0] to a[10]

Answer: a[0] to a[9]


Question: The index or subscript value for an array of size n ranges from

  • a) 1 to n-1
  • b) 0 to n-1
  • c) 1 to n
  • d) 0 to n

Answer: 0 to n-1


Question: If a static array is not initialized, the elements will be set to_________

  • a) 0
  • b) A float number
  • c) An undetermined value
  • d) A character constant

Answer: 0


Question: If 'a' is the object of String class and its content is "AHMEDABAD", then what is the value of str.length()?

  • a) 9
  • b) 10
  • c) 8
  • d) 11

Answer: 9


Question: If 'a' is the object of String class and its content is "C IS A LANGUAGE", then what is the value of str.length()

  • a) 14
  • b) 15
  • c) 12
  • d) 11

Answer: 15


Question: What type of value is returned when we use get method of Calender class with constant MONTH ?

  • a) Char
  • b) String
  • c) Int
  • d) Boolean!

Answer: Int

 

Question: Method to String() returns________data type.

  • a) Char
  • b) String
  • c) Int
  • d) Boolean

Answer: String


Question: Method getTime() returns________data type.

  • a) Long
  • b) String
  • c) Void
  • d) Date

Answer: Long


Question: Method concat(String str) returns______datatype,

  • a) Long
  • b) String
  • c) Void
  • d) Date

Answer: String


Question: What is the full form of GMT ?

  • a) Greenwich Median Time
  • b) Greenwich Mode Time
  • c) Greenwich Modern Time
  • d) Greenwich Mean Time

Answer: Greenwich Mean Time


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: 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: A_____contains both data and program code (functions referred to as methods).

  • a) Function
  • b) Class
  • c) Attribute
  • d) Code

Answer: Class


Question: When the class is executed, the______method is called and the application runs as a normal program.

  • a) Main
  • b) Sub
  • c) Super
  • d) Super Main

Answer: Main


Question: In earlier programs no data______were used.

  • a) Codes
  • b) Classes
  • c) Members
  • d) Applications

Answer: Members


Question: While it is possible to use only a single class in a______project, this is not a good practice for large applications.

  • a) Java
  • b) C++
  • c) PHP
  • d) C

Answer: Java


Question: When designing software, the entire_____should be divided into simpler components that perform logically related tasks.

  • a) Code
  • b) Class
  • c) Program
  • d) Application

Answer: Application


Question: For each above mentioned component or module, a_____can be created.

  • a) Function
  • b) Class
  • c) Attribute
  • d) Code

Answer: Class


Question: When a program contains two or more classes, only one class can cantain the_____method.

  • a) Main()
  • b) Major
  • c) Main()
  • d) Minor

Answer: Main()


Question: What is SciTE editor ?

  • a) SCintilla based Text Editor
  • b) Scientific based Text Editor
  • c) Sourceful Text Editor
  • d) Syntax Text Editor

Answer: SCintilla based Text Editor


Question: A class is a template for multiple objects with similar features.

  • a) Function
  • b) Class
  • c) Attribute
  • d) Code

Answer: Class


Question: ________embody all the features of a particular set of objects.

  • a) Codes
  • b) Classes
  • c) Members
  • d) Applications

Answer: Classes


Question: For example, class 'Room' is a______for all rooms with their common properties.

  • a) Pattern
  • b) Protocol
  • c) Template
  • d) Model

Answer: Template


Question: In Java, a class is defined using_____keyword.

  • a) Public
  • b) Class
  • c) Class
  • d) Void

Answer: Class


Question: Every class the programmer writes in Java is generally made up of____components.

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

Answer: Two


Question: ______and behavior are the components of every class.

  • a) Properties
  • b) Mannerism
  • c) Patterns
  • d) Attributes

Answer: Attributes


Question: ________are defined by variables in a class.

  • a) Properties
  • b) Mannerism
  • c) Patterns
  • d) Attributes

Answer: Attributes


Question: _______is defined by methods in a class.

  • a) Behavior
  • b) Mannerism
  • c) Patterns
  • d) Properties

Answer: Behavior


Question: ______are used to access or modify attributes.

  • a) Behavior
  • b) Methods
  • c) Modifiers
  • d) Attributes

Answer: Methods


Question: ______means a reference variable name of type class.

  • a) Instantiation
  • b) Initialization
  • c) Declaration
  • d) Modification

Answer: Declaration


Question: A______is declared with syntax.

  • a) Instantiation
  • b) Initialization
  • c) Declaration
  • d) Modification

Answer: Declaration


Question: _______means creating the object by allocating the memory.

  • a) Instantiation
  • b) Initialization
  • c) Declaration
  • d) Modification

Answer: Instantiation


Question: Keyword______is used to create the object by allocating memory.

  • a) Old
  • b) old
  • c) New
  • d) new

Answer: new


Question: ______means to initialize the newly created object.

  • a) Initialization
  • b) Instantiation
  • c) Declaration
  • d) Modification

Answer: Initialization


Question: A______is called to initialize the newly created object.

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

Answer: Constructor


Question: A______is a special type of method.

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

Answer: Constructor


Question: In Java, a class is a______

  • a) Brand
  • b) Kind
  • c) Type
  • d) Form

Answer: Type


Question: In Java, the______examples are int and Boolean.

  • a) Brand types
  • b) Form types
  • c) Built-in types
  • d) None of these

Answer: Built-in types


Question: A_______can be used to specify the type of a variable in a declaration statement, the type of a formal parameter, or the return type of a function.

  • a) Class declaration
  • b) Class name
  • c) Class types
  • d) All of these

Answer: Class name


Question: Declaring a variable does not create a________

  • a) Object
  • b) Memory space
  • c) Class
  • d) Boolean

Answer: Object


Question: In Java, no_____can ever store an object.

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

Answer: Variable


Question: A variable declared using class type can only store a_____to an object.

  • a) Orientation
  • b) Position
  • c) Reference
  • d) Indication

Answer: Reference

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

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 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...

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