CBSE Class 12 Computer Science Java Basics MCQs Set B

CBSE Class 12 Computer Science Java Basics MCQs Set E 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 syllabus, NCERT books and examination pattern suggested in Standard 12 by CBSE, NCERT and KVS. Multiple Choice Questions are an important part of Term 1 and Term 2 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

Java Basics Class 12 Computer Science MCQ

Class 12 Computer Science students should refer to the following multiple-choice questions with answers for Java Basics in standard 12. These MCQ questions with answers for Grade 12 Computer Science will come in exams and help you to score good marks

Java Basics MCQ Questions Class 12 Computer Science with Answers

Question: Upper case and lower case letters are considered to be_____

  • a) Same
  • b) Similar
  • c) Different
  • d) Related

Answer: Different


Question: In Java, it is customary for names of_____to begin with upper case letters.

  • a) Variables
  • b) Methods
  • c) Comments
  • d) Classes

Answer: Classes


Question: In Java, it is customary for names of_____to begin with lower case letters.

  • a) Variables
  • b) Methods
  • c) Comments
  • d) Both (A) and (B)

Answer: Both (A) and (B)


Question: Which of the following is not a good programming style for declaring variables ?

  • a) Declare ten variables in a declaration statement
  • b) Include a comment with each variable declaration to explain its purpose
  • c) Declare important variables at the beginning of the function
  • d) None of these

Answer: Declare ten variables in a declaration statement


Question: In Java, there are_____kinds of variables.

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

Answer: Three


Question: Which of the following is a kind of variable in Java ?

  • a) Instance variable
  • b) Class variable
  • c) Local variable
  • d) All of these

Answer: All of these


Question: Function parameters and variables declared in the function are considered as_____variables.

  • a) External
  • b) Internal
  • c) Local
  • d) Limited

Answer: Local


Question: Each variable can be given a____value while declaring.

  • a) Initial
  • b) Last
  • c) Cumulative
  • d) Opening

Answer: Initial


Question: In general, syntax of declaring variables is______

  • a){variable =,};
  • b){variable [=,]};
  • c) type name {variable [=,]};
  • d){variable [=,]}

Answer: {variable [=,]};


Question: In variable declaration syntax, the_____denotes optional item.

  • a) Curly brackets { }
  • b) Square brackets [ ]
  • c) Angle brackets < >
  • d) Round brackets ()

Answer: Square brackets [ ]


Question: It is programmer's responsibility to assign value to____before their first use.

  • a) Variables
  • b) Methods
  • c) Comments
  • d) Both (A) and (B)

Answer: Variables


Question: A name used for a constant value is known as

  • a) Data types
  • b) Variables
  • c) Literals
  • d) Comments

Answer: Literals


Question: There are some different kinds of_____in Java for number, character, string and Boolean values.

  • a) Data types
  • b) Variables
  • c) Literals
  • d) Comments

Answer: Literals


Question: ____are used to represent integer or real numbers; for example, 157 and 17.42.

  • a) Numeric Variables
  • b) Numeric Literals
  • c) Integer Literals
  • d) Character Literals

Answer: Numeric Literals


Question: Java allows Unicode integer literals called Decimal whose base is______

  • a) 10
  • b) 8
  • c) 16
  • d) 32

Answer: 10


Question: Java allows Unicode integer literals called Octal whose base is______.

  • a) 10
  • b) 8
  • c) 16
  • d) 32

Answer: 8


Question: A decimal integer larger than int is automatically of type_____

  • a) Short
  • b) Long
  • c) Float
  • d) Mixed

Answer: Long


Question: _____integers such as 4, 157, 17777 and -32 are decimal integer literals of type byte, short or int depending on their size.

  • a) Ordinary
  • b) Simple
  • c) Complicated
  • d) Real

Answer: Ordinary


Question: ______integers such as 4, 157, 17777 and -32 are decimal integer literals of type byte, short or int depending on their size.

  • a) Ordinary
  • b) Simple
  • c) Complicated
  • d) Real

Answer: Ordinary


Question: Java allows Unicode integer literals called Hexadecimal whose base is______

  • a) 10
  • b) 8
  • c) 16
  • d) 32

Answer: 16


Question: The user can force a smaller number to be long by appending an_____as a suffix to that number.

  • a) S or s
  • b) A or a
  • c) L or l
  • d) M or m

Answer: L or l


Question: ____integers are preceded by a minus (-) sign,for example, -45.

  • a) Positive
  • b) Real
  • c) Large
  • d) Negative

Answer: Negative


Question: _____numbers use only the digits 0 through 7. In Java, a numeric literal with a leading 0 (zero) is interpreted as an octal number.

  • a) Hexadecimal
  • b) Octal
  • c) Decimal
  • d) Real

Answer: Octal


Question: _______numbers use 16 digits, the usual digits 0 to 9 and the letters A, B, C, D, E, and F.

  • a) Hexadecimal
  • b) Octal
  • c) Decimal
  • d) Real

Answer: Hexadecimal


Question: In Hexadecimal, the letters _______ represent the numbers 10 to 15 respectively.

  • a) A to E
  • b) A to G
  • c) A to F
  • d) A to D

Answer: A to F


Question: In Java, a______literal begins with Ox or OX.

  • a) Hexadecimal
  • b) Octal
  • c) Decimal
  • d) Real

Answer: Hexadecimal


Question: Examples of______literals are 0x45 or 0xFF7A.

  • a) Hexadecimal
  • b) Octal
  • c) Decimal
  • d) Real

Answer: Hexadecimal


Question: _____numbers are also used in character literals to represent arbitrary Unicode characters.

  • a) Hexadecimal
  • b) Octal
  • c) Decimal
  • d) Real

Answer: Hexadecimal


Question: A_____literal consists of \u followed by four hexadecimal digits.

  • a) Hexacode
  • b) Unicode
  • c) Byte code
  • d) None of these

Answer: Unicode


Question: Which of the following is error free ?

  • a) For(;;) { int i=10 };
  • b) While (1) { int i=10 };
  • c) While (True) { int i=10 };
  • d) All of these

Answer: All of these

 

Question: The________statement makes use of branchinj decision making.

  • a) While
  • b) For
  • c) If
  • d) Do...While

Answer: If


Question: _______literals are called floating point literals.

  • a) Real integer
  • b) Real point
  • c) Real float
  • d) Real number

Answer: Real number


Question: _______numbers can be represented using two types of notations : standard and scientific.

  • a) Real integer
  • b) Real point
  • c) Real float
  • d) Real number

Answer: Real number


Question: hi standard notations, the integer part and the fractional part are separated with______for example 12.37.

  • a) Decimal point (.)
  • b) Comma (,)
  • c) Colon (:)
  • d) Semi-colon (;)

Answer: Decimal point (.)


Question: In scientific notation a number is followed by letter________and a signed integer exponent, for example 1.3el2 and 12.3737e-108.

  • a) X or x
  • b) S or s
  • c) E or e
  • d) Both (A) and (C)

Answer: E or e


Question: ________format can be used to express very large and very small numbers.

  • a) Scientific
  • b) Unicode
  • c) ASCII
  • d) Binary

Answer: Scientific


Question: In Java, floating point literal by default is of the type_______

  • a) Long
  • b) Float
  • c) Double
  • d) Single

Answer: Double


Question: The suffix_______can be written in either lower or upper case.

  • a) F
  • b) R
  • c) X
  • d) OX

Answer: F


Question: For the type________there are precisely two literals : true and false.

  • a) Integer
  • b) Real
  • c) Character
  • d) Boolean

Answer: Boolean


Question: _______literals are to be types without quotes.

  • a) Integer
  • b) Real
  • c) Character
  • d) Boolean

Answer: Boolean

 

Question: _______literals represent values, not variables.

  • a) Integer
  • b) Real
  • c) Character
  • d) Boolean

Answer: Boolean


Question: Boolean values occur most often as the values of conditional_______

  • a) Expressions
  • b) Statements
  • c) Methods
  • d) True or false

Answer: Expressions


Question: In C language, 0 is treated as false and_______value is treated as true.

  • a) Number
  • b) Non-zero
  • c) Character
  • d) None of these

Answer: Non-zero


Question: In Java, literals true and false are not associated with any_______value.

  • a) ASCII
  • b) Real
  • c) Numeric
  • d) Expression

Answer: Numeric


Question: literals are expressed by a single character surrounded by single quotes.

  • a) Integer
  • b) Real
  • c) Character
  • d) Boolean

Answer: Character


Question: Characters are stored as______Unicode characters.

  • a) 16-bit
  • b) 8-bit
  • c) 32-bit
  • d) 64-bit

Answer: 16-bit


Question: Certain special characters have special literals that use a_______as an "escape character".

  • a) Slash (/)
  • b) Back slash (\)
  • c) Both (A) and (B)
  • d) None of these

Answer: Back slash (\)


Question: '\n' Escape code means_______

  • a) Tab
  • b) Line
  • c) New Line
  • d) Backspace

Answer: New Line


Question: '\t' Escape code means_____

  • a) Tab
  • b) Line
  • c) New Line
  • d) Backspace

Answer: Tab


Question: A_______is used when a conversion of a value has to be forced.

  • a) Fun cast
  • b) Cast
  • c) Operator Cast
  • d) Type Cast

Answer: Type Cast


Question: In Java, operators are evaluated as per their precedence.

  • a) Order
  • b) Continuity
  • c) Precedence
  • d) Evaluation

Answer: Precedence


Question: When two operators with the same precedence appear in the expression, the expression is evaluated according to its______

  • a) Order
  • b) Associatively
  • c) Precedence
  • d) Evaluation

Answer: Associatively


Question: The Associativity of Unary operators is from :

  • a) Left-to-Right
  • b) Right-to-Left
  • c) Both (A) and (B)
  • d) None of these

Answer: Right-to-Left


Question: The Associativity of Logical operators is from :

  • a) Left-to-Right
  • b) Right-to-Left
  • c) Both (A) and (B)
  • d) None of these

Answer: Left-to-Right


Question: The Associativity of Conditional operators is from :

  • a) Left-to-Right
  • b) Right-to-Left
  • c) Both (A) and (B)
  • d) None of these

Answer: Right-to-Left


Question: The Associativity of Relational operators is from :

  • a) Left-to-Right
  • b) Right-to-Left
  • c) Both (A) and (B)
  • d) None of these

Answer: Left-to-Right


Question: The statements that enable the flow of ^execution are considered as______

  • a) Blocks
  • b) Structures
  • c) Control structures
  • d) Logical structures

Answer: Control structures


Question: There are_____types of control structures.

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

Answer: Two


Question: ________are used to repeat a sequence of statements over and over until some condition occurs.

  • a) Structures
  • b) Charts
  • c) Branches
  • d) Loops

Answer: Loops


Question: ______are used to choose among two or more possible courses of action, so also called selective structure.

  • a) Structures
  • b) Blocks
  • c) Branches
  • d) Loops

Answer: Branches

 

Question: A block statement is a group of statement enclosed between a pair of______braces.

  • a) { and }
  • b) < and >
  • c) ( and )
  • d) [ and ]

Answer: { and }


Question: A______declared inside a block is completely inaccessible and invisible from OUtSlde that block.

  • a) Variable
  • b) Name
  • c) Integer
  • d) Number

Answer: Variable


Question: The_______of a variable defined inside a block is limited to that block only.

  • a) Area
  • b) Locality
  • c) Scope
  • d) Range

Answer: Scope


Question: The_____when used in a program enables to take one of two alternative courses of action, depending on whether the value of a given Boolean-valued expression is true or false.

  • a) Else Statement
  • b) If Statement
  • c) While
  • d) Do....while

Answer: If Statement


Question: _____is an example of a "branching" or "decision" or "selective" control structure.

  • a) Switch statement
  • b) If statement
  • c) While
  • d) Do....while

Answer: If statement


Question: A_____is used when there are many alternative actions to be taken depending upon the value of a variable or expression.

  • a) Switch Statement
  • b) If Statement
  • c) While
  • d) Do....while

Answer: Switch Statement


Question: In the________the test expression should be of the type byte, char, short or int. It can also be of enum data type.

  • a) Switch Statement
  • b) If Statement
  • c) While
  • d) Do....while

Answer: Switch Statement


Question: Java supports_____Types of looping constructs.

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

Answer: Three


Question: Which of the following is a type of looping construct in Java ?

  • a) For
  • b) While
  • c) Do...while
  • d) All of these

Answer: All of these

 

Question: The_______statement is used to transfer the control outside switch or loop structure.

  • a) For
  • b) While
  • c) Continue
  • d) Break

Answer: Break


Question: In a loop______statement is used to exit the loop.

  • a) For
  • b) While
  • c) Continue
  • d) Break

Answer: Break


Question: Use of______statement is used to skip the following statements in a loop and continue with the next iteration.

  • a) For
  • b) While
  • c) Continue
  • d) Break

Answer: Continue


Question: ______of same or different types can be nested in Java.

  • a) Loops
  • b) Controls
  • c) Charts
  • d) Structures

Answer: Loops


Question: If the programmer wants to control which loop to break and which loop to reiterate_______can be used.

  • a) Labeled Controls
  • b) Labelled Loops
  • c) Named Controls
  • d) Named Loops

Answer: Labelled Loops


Question: To use a labelled loop, add the label followed by_____before the loop.

  • a) Semi Colon (;)
  • b) Colon (:)
  • c) Full stop (.)
  • d) All of these

Answer: Colon (:)


Question: The default value of Boolean type data is_____

  • a) True
  • b) False
  • c) 0
  • d) 1

Answer: False


Question: What will be the result of arithmetic expression 11/2 ?

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

Answer: 5.5


Question: 11%2 will give the output as_______

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

Answer: 1


Question: ______character set is used for char data type in Javj

  • a) Unicode
  • b) EBCIDIC
  • c) ASCII
  • d) All of these

Answer: Unicode


Question: What will be the output of the expressio 5*(6+2) 11 ?

  • a) 19
  • b) 20
  • c) 21
  • d) 22

Answer: 20

Tags: 

 


Click for more Computer Science Study Material
Cascading Style Sheets and JavaScript
CBSE Class 12 Computer Science Cascading Style Sheets and JavaScript MCQs
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
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
Designing Simple Website Using Kompozer
CBSE Class 12 Computer Science Designing Simple Website Using Kompozer MCQs
Exception Handling In Java
CBSE Class 12 Computer Science Exception Handling In Java MCQs
File Handling
CBSE Class 12 Computer Science File Handling MCQs Set A
CBSE Class 12 Computer Science File Handling MCQs Set B
File System
CBSE Class 12 Computer Science File System MCQs Set A
CBSE Class 12 Computer Science File System MCQs Set B
Introduction To E Commerce
CBSE Class 12 Computer Science Introduction To E Commerce MCQs
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
Java Basics
CBSE Class 12 Computer Science Java Basics MCQs Set A
CBSE Class 12 Computer Science Java Basics MCQs Set B
Object Oriented Concepts
CBSE Class 12 Computer Science Object Oriented Concepts MCQs
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

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 OMR Sheet Guidelines for Term 1

You are aware that the CBSE will be using OMR for the first time for assessment of both the Classes-X and XII in Term-I examinations. Hence, there is a need that all the students appearing in the Term-l examinations and the schools sponsoring these students should have...

CBSE Class 10 Revised Syllabus

Last year CBSE had to reduce the syllabus because of the pandemic situation but it was not very effective because there were no examinations. This year to avoid any confusion and conflict, CBSE has decided to reduce the syllabus into term 1 and term 2. 50 percent of...

All India Children Educational Audio Video Festival

The Central Institute of Educational Technology (CIET), a constituent unit of National Council of Educational Research and Training (NCERT), is inviting entries for the 26th All India Children’s Educational Audio Video Festival (AICEAVF). This festival showcases the...

MCQ Question based CBSE examination

For 2021-22 CBSE has launched MCQ question-based examination for Term 1 & Term 2 board examinations. The entire syllabus has been divided into two parts each including 50% of the entire syllabus. To score well, students must practice as per the new CBSE term-wise...

Online courses for classes XI and XII offered by NCERT

Ministry of Education (MoE), Government of India has launched a platform for offering Massive Open Online Courses (MOOCs) that is popularly known as SWAYAM (Study Webs of Active learning for Young Aspiring Minds) on 9 th July, 2017. NCERT now offers online courses for...

How To Solve Unseen Passages In English

Unseen passages may contain one or many paragraphs. This is one of the important yet easy parts for a student to get marks. Students should thoroughly study and understand the passage to answer the related questions. The unseen passages are there just to test the...