GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Well-structured Std 12 Computer Textbook MCQ Answers and Std 12 Computer MCQ Answers Ch 7 Java Basics can serve as a valuable review tool before computer exams.

GSEB Std 12 Computer Chapter 7 MCQ Java Basics

Question 1.
What is Java ?
(A) A scripting language
(B) Object oriented programming language
(C) File oriented language
(D) Structured programming language
Answer:
(B) Object oriented programming language

Question 2.
Java language is developed ……………… for workstation.
(A) Unix
(B) Linux
(C) Windows
(D) Mac
Answer:
(A) Unix

Question 3.
Java was developed in the year ……………. .
(A) 1990
(B) 1992
(C) 1991
(D) 1993
Answer:
(C) 1991

Question 4.
……………. company developed Java.
(A) Intel
(B) Oracle
(C) Sun Microsystems
(D) Microsoft
Answer:
(C) Sun Microsystems

Question 5.
Java is small, simple and portable across platforms and operating systems, at the ……………… level.
(A) source program
(B) Binary
(C) hexa numbers
(D) (A) and (B) both
Answer:
(D) (A) and (B) both

Question 6.
Java language is developed after ……………. language.
(A) C
(B) C ++
(C) COBOL
(D) FORTRAN
Answer:
(B) C ++

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 7.
Which sentence is true about Java language ?
(A) It is an object oriented language
(B) It was developed in 1991 by Sun Microsystems
(C) It can work at source level and binary level
(D) All of these
Answer:
(D) All of these

Question 8.
……………. is very similar to C++ language.
(A) C
(B) FORTRAN
(C) COBOL
(D) Java
Answer:
(C) COBOL

Question 9.
Java is portable to a wide range of ……………. .
(A) small devices
(B) efficient devices
(C) hardware devices
(D) big devices
Answer:
(C) hardware devices

Question 10.
Which sentence is false for Java ?
(A) It is ideal for distributing executable programs
(B) It can easily be used on different platforms
(C) It is considered General Purpose Programming Language
(D) It is considered as scripting language
Answer:
(D) It is considered as scripting language

Question 11.
Which type of program codes can be written using Java ?
(A) Object oriented
(B) Flexible modular
(C) Reusable
(D) All of these
Answer:
(D) All of these

Question 12.
Java Class Library provides feature of ……………… utilities functions.
(A) basic data types
(B) system input
(C) output abilities
(D) all of these
Answer:
(D) all of these

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 13.
What is basic class ?
(A) A part of Java Development Kit (JDK)
(B) Information of class
(C) (A) and (B) both
(D) No class is there
Answer:
(A) A part of Java Development Kit (JDK)

Question 14.
What types of classes are there in JDK ?
(A) For networking
(B) For internet protocols
(C) For user interface toolkit
(D) All of these
Answer:
(D) All of these

Question 15.
All classes of Java library are written in …………….. .
(A) Java
(B) Linux
(C) Unix
(D) C language
Answer:
(A) Java

Question 16.
At what Java is platform independent ?
(A) Source Program and hexadigits
(B) Source program and binary level
(C) At binary and decimal
(D) Source program and decimal digital
Answer:
(B) Source program and binary level

Question 17.
What is the meaning of platform independent ?
(A) Anything can be done in Java.
(B) It can be moved from one computer system to the other.
(C) (A) and (B) both
(D) Doing anything at platform level.
Answer:
(B) It can be moved from one computer system to the other.

Question 18.
At ………….. level, Java’s primitive data types have consistent sizes across all development platforms.
(A) Source Program
(B) Binary Level
(C) Hexa level
(D) None of these
Answer:
(A) Source Program

Question 19.
At …………….. level, platform-independece is possible due to bytecode interpreter.
(A) Source Program
(B) Binary Level
(C) Flexa level
(D) None of these
Answer:
(B) Binary Level

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 20.
Designers of Java choose to use ……………. .
(A) compilation
(B) interpretation
(C) combination of compilation and interpretation
(D) (A) or (B)
Answer:
(C) combination of compilation and interpretation

Question 21.
JVM stands for …………….. .
(A) Java Videshi Machine
(B) Java Virtual Machine
(C) Joint Virtual Machine
(D) Java Virtual Mechanism
Answer:
(B) Java Virtual Machine

Question 22.
The machine language of JVM is ……………. .
(A) Java Bite Code
(B) Java Machine Code
(C) Java Binary code
(D) Java Hexa code
Answer:
(A) Java Bite Code

Question 23.
Which sentence is false related for JVM ?
(A) Programs written in Java are compiled into machine language for a computer that doesn’t really exist.
(B) Java Bytecode interpreter are same for each type of computer.
(C) Java binary files are actually in bytecode form.
(D) Java byte code are not fixed for a processor or any operating system.
Answer:
(B) Java Bytecode interpreter are same for each type of computer.

Question 24.
What is the disadvantage of using bytecode ?
(A) It is a machine language.
(B) It is slow in processing
(C) It is costly
(D) All of these
Answer:
(B) It is slow in processing

Question 25.
Using tools in Java bytecode is converted to …………… .
(A) Gative code
(B) Panic code
(C) Native code
(D) Machine code
Answer:
(C) Native code

Question 26.
…………….. code is faster to execute.
(A) Machine
(B) Native
(C) Panic
(D) Gative
Answer:
(B) Native

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 27.
…………… program is made of many classes.
(A) C
(B) C ++
(C) Java program
(D) FORTRAN
Answer:
(C) Java program

Question 28.
Minimum how many classes are required in Java program ?
(A) 2
(B) 3
(C) 4
(D) 1
Answer:
(D) 1

Question 29.
Which method must be there in Java program ?
(A) main
(B) public
(C) type
(D) All of these
Answer:
(A) main

Question 30.
What is not available in Java ?
(A) main
(B) typedef
(C) Bite code
(D) All of these
Answer:
(B) typedef

Question 31.
Java source file is saved with …………… extension.
(A) .doc
(B) .jav
(C) Java
(D) .class
Answer:
(C) Java

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 32.
……………. works as a Java compiler.
(A) jrd
(B) Javac
(C) SciTE
(D) Java
Answer:
(B) Javac

Question 33.
After errorless compilation of Java program …………….. file is automatically created.
(A) .class
(B) .java
(C) .cmp
(D) .jacm
Answer:
(A) .class

Question 34.
file is also called byte code file.
(A) Callcost.java
(B) Callcost.class
(C) Callcost.javac
(D) Callcost.byte
Answer:
(B) Callcost.class

Question 35.
Byte code file is also known as ………….. .
(A) source file
(B) file with extension .java
(C) file compiled with compiler
(D) executable file
Answer:
(C) file compiled with compiler

Question 36.
Bytecode file has ………….. extension.
(A) .java
(B) .jdk
(C) .class
(D) javac
Answer:
(C) .class

Question 37.
……………. compiler is used to execute the file which is compiled by the compiler.
(A) java
(B) SciTE
(C) javac
(D) run
Answer:
(A) java

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 38.
Java interpreter executes the file having extension only …………. .
(A) .java
(B) .class
(C) .jav
(D) .jdk
Answer:
(B) .class

Question 39.
……………….. compiler makes the bytecode file in Java language.
(A) jdk
(B) javac
(C) ecj
(D) None of these
Answer:
(B) javac

Question 40.
What is the general name of bytecode file ?
(A) Any name can be given
(B) class name having main
(C) The name of Java source file
(D) (B) and (C) both
Answer:
(D) (B) and (C) both

Question 41.
…………. routine is executed first when program is executed in Java application.
(A) main()
(B) void()
(C) (A) and (B) both
(D) none of these
Answer:
(A) main()

Question 42.
The body of Java program is included in …………… routine.
(A) main()
(B) display()
(C) body()
(D) void()
Answer:
(A) main()

Question 43.
Comment in Java program is written with …………….. sign.
(A) //
(B) between /* and */
(C) (A) and (B) both
(D) between // and //
Answer:
(C) (A) and (B) both

Question 44.
………………. part of Java program is neither compiled nor interpreted.
(A) Body
(B) Function
(C) Comment
(D) Procedure
Answer:
(C) Comment

Question 45.
……………. subroutine statements are used to display information of Java program to the user.
(A) Function
(B) Method
(C) (A) or (B)
(D) (A) and (B) both
Answer:
(C) (A) or (B)

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 46.
What is the name of method which is used to display information in Java program ?
(A) System.out.print
(B) System.out.printin
(C) (A) and (B) both
(D) system.out.print
Answer:
(C) (A) and (B) both

Question 47.
…………… method can display information and leave a single line.
(A) System.out.print
(B) System.out.println
(C) System.print.out
(D) System.out.displayline
Answer:
(B) System.out.println

Question 48.
…………… method can only display information to the user.
(A) System.out.print
(B) System.out.println
(C) System.print.out
(D) System.out.displayline
Answer:
(A) System.out.print

Question 49.
The textual data is given in …………….. symbol in System.out.print.
(A) (‘ ‘) (Single quote)
(B) (” “) (Double quote)
(C) (# #) (Hash sign)
(D) None of these
Answer:
(B) (” “) (Double quote)

Question 50.
When Java program is sent to interpreter, it goes to ……………… method first.
(A) main()
(B) body()
(C) display()
(D) none of these()
Answer:
(A) main()

Question 51.
Which sentence is true about main() routine ?
(A) Java Interpreter goes to main() method first.
(B) main() routine can call the subroutine which is actually defined in other class.
(C) main() routine decides the other subroutine to be used how and in which sequence.
(D) All of these
Answer:
(D) All of these

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 52.
What is the meaning of ‘public’ with main() ?
(A) Subroutine can only be called from inside the program.
(B) Subroutine can only be called from outside the program.
(C) To display general information
(D) None of these.
Answer:
(B) Subroutine can only be called from outside the program.

Question 53.
In our syllabus, ……………… editor is to be used for Java application.
(A) Text Editor
(B) SciTE Editor
(C) Gedit
(D) None of these
Answer:
(B) SciTE Editor

Question 54.
How to compile Java source file in SciTE editor ?
(A) Option → Compile
(B) Tools → Compile
(C) Edit → Compile
(D) File → Compile
Answer:
(B) Tools → Compile

Question 55.
How to execute the program in SciTE editor ?
(A) Tools → Go
(B) Tools → Run
(C) Option → Go
(D) Option → Run
Answer:
(A) Tools → Go

Question 56.
Syntax rules use …………… as basic vocabulary.
(A) variable, expressions
(B) statements, branches
(C) loop and method
(D) All of these
Answer:
(D) All of these

Question 57.
What is the definition of a method ora function ?
(A) Function header and statements between < and >
(B) Function header and statements between { and }
(C) Statements between { and }
(D) Statements between < and >
Answer:
(B) Function header and statements between { and }

Question 58.
……………. class must be there in Java program.
(A) public method main()
(B) display()
(C) public method body()
(D) None of these
Answer:
(A) public method main()

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 59.
Java language can be called ……………. language.
(A) formatted language
(B) free formatted language
(C) structured programming language
(D) None of these.
Answer:
(B) free formatted language

Question 60.
What is defined by data type ?
(A) Required memory size
(B) Type of values in the memory
(C) Range of values
(D) All of these
Answer:
(D) All of these

Question 61.
How many primitive data types are there in Java language ?
(A) 5
(B) 7
(C) 8
(D) 6
Answer:
(C) 8

Question 62.
What is handled by primitives ?
(A) General integer and real numbers
(B) Characters
(C) Boolean values
(D) All of these
Answer:
(D) All of these

Question 63.
…………… is not the primitive data type in Java.
(A) byte
(B) class
(C) short
(D) int
Answer:
(B) class

Question 64.
………….. is not primitive of Java.
(A) class
(B) long
(C) float
(D) char
Answer:
(A) class

Question 65.
char data type has a character from ………………… group of characters.
(A) Unicode
(B) IEEE
(C) ASCII
(D) All of these
Answer:
(A) Unicode

Question 66.
Which logical value is taken by Boolean data type ?
(A) true
(B) false
(C) (A) or (B)
(D) (A) and (B) both
Answer:
(C) (A) or (B)

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 67.
The data types which are included in the system are called ……………… .
(A) Primary
(B) Primitive
(C) (A) or (B)
(D) (A) and (B) both
Answer:
(C) (A) or (B)

Question 68.
How are the data types in Java language ?
(A) Dependent on other
(B) Machine independent
(C) Dependent on data
(D) All of these
Answer:
(B) Machine independent

Question 69.
How much size is occupied by the byte data type ?
(A) 1 byte
(B) 2 byte
(C) 4 byte
(D) 8 byte
Answer:
(A) 1 byte

Question 70.
What is the default value in byte data type ?
(A) 1
(B) 0
(C) 128
(D) 255
Answer:
(B) 0

Question 71.
How much size is occupied by int data type ?
(A) 1 byte
(B) 2 byte
(C) 4 byte
(D) 8 byte
Answer:
(C) 4 byte

Question 72
Match the following pairs.

Data type Storage Space
(1) char (i) 2 byte
(2) boolean (ii) 4 byte
(3) float (iii) 8 byte
(4) double (iv) 1 byte

(A) (1 → i), (2 → iv), (3 → iii), (4 → i)
(B) (1 → iv), (2 → ii), (3 → iii), (4 → i)
(C) (1 → ii), (2 → iv), (3 → i), (4 → iii)
(D) (1 → i), (2 → iv), (3 → ii), (4 → iii)
Answer:
(D) (1 → i), (2 → iv), (3 → ii), (4 → iii)

Data type Storage Space
(1) char (i) 2 byte
(2) boolean (iv) 1 byte
(3) float (ii) 4 byte
(4) double (iii) 8 byte

Question 73.
What is the default value of boolean data type ?
(A) 1
(B) 0
(C) true
(D) false
Answer:
(D) false

Question 74.
In which data type default value is false ?
(A) float
(B) short
(C) boolean
(D) char
Answer:
(C) boolean

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 75.
In which data type storage space is of 4 bytes ?
(A) int
(B) float
(C) (A) and (B) both
(D) char
Answer:
(C) (A) and (B) both

Question 76.
In which data type storage space is of 8 bytes ?
(A) int
(B) long
(C) double
(D) (B) and (C) both
Answer:
(D) (B) and (C) both

Question 77.
In which range of values will be stored in integer numbers with b bits precision store signed values ?
(A) -2b – 1 to 2b – 1
(B) -2b – 1-1 to 2b – 1
(C) -2b – 1 to 2b – 1 -1
(D) -2b – 1 -1 to 2b – 1 + 1
Answer:
(B) -2b – 1-1 to 2b – 1

Question 78.
In which range of values will be stored in unsigned integer ?
(A) 0 to 2bb – 1
(B) 0 to 2b – 1 – 1
(C) 0 to 2b – 1
(D) 0 to 2b – 1 + 1
Answer:
(C) 0 to 2b – 1

Question 79.
Floating point values are compatible with …………….. in Java.
(A) IEEE
(B) IEEE754
(C) IEEE254
(D) None of these
Answer:
(B) IEEE754

Question 80.
Java language uses ……………….. characters.
(A) Unicode
(B) ASCII
(C) Octal
(D) Binary
Answer:
(A) Unicode

Question 81.
char has the precision of …………………. bytes.
(A) 2
(B) 4
(C) 8
(D) 16
Answer:
(D) 16

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 82.
Due to ………………., Java can use thousands of characters with different character sets.
(A) char data type has the precision of 8 bits
(B) char data type has the precision of 16 bits
(C) it has 8 types of data types
(D) range is quite high for data types in Java
Answer:
(B) char data type has the precision of 16 bits

Question 83.
……………… data type is not considered as a number.
(A) char
(B) float
(C) boolean
(D) double
Answer:
(C) boolean

Question 84.
The name used to store the data in the memory is known as ………………… .
(A) string
(B) function
(C) word
(D) (A) or (C)
Answer:
(A) string

Question 85.
How many memory locations can be indicated at a time in a variable ?
(A) Many
(B) 2
(C) Only One
(D) 8
Answer:
(C) Only One

Question 86.
S = 10;
S = S + 2;
S = 22;
What will be the value of S ?
(A) 10
(B) 12
(C) 22
(D) no output
Answer:
(C) 22

Question 87.
What syntax is used to declare multiple variables in Java ?
(A) <type – name> {variable – name};
(B) <ctype – name> (variable – name);
(C) >type – name> <variable – name>;
(D) type – name {variable – name};
Answer:
(A) <type – name> {variable – name};

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 88.
What sign is used to declare multiple variables in Java ?
(A) ,
(B) ;
(C) :
(D) #
Answer:
(A) ,

Question 89.
What is the use of data type ?
(A) Defines the size of a variable
(B) Type of values stored in a variable
(C) (A) and (B) both
(D) To run the program
Answer:
(C) (A) and (B) both

Question 90.
…………. is not a valid variable.
(A) date
(B) % discount
(C) CallCost
(D) $price
Answer:
(B) % discount

Question 91.
…………… is a valid variable.
(A) 4me
(B) % Sanjay
(C) _result
(D) % discount
Answer:
(C) _result

Question 92.
…………… is not a reserved word of Java.
(A) class
(B) public
(C) static
(D) Sanjay
Answer:
(D) Sanjay

Question 93.
Variable can be given of maximum ……………….. characters in Java language.
(A) 8
(B) 16
(C) 255
(D) any length
Answer:
(D) any length

Question 94.
What to follow while giving a variable name in Java ?
(A) camel case
(B) _ (underscore) sign
(C) Using space
(D) (A) or (B)
Answer:
(D) (A) or (B)

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 95.
In a variable name from second word first character of each word is given in upper case is known as ………………… .
(A) camel case
(B) special case
(C) space case
(D) none of these
Answer:
(A) camel case

Question 96.
……………. is the example of camel case.
(A) balanceAmount
(B) birth_date
(C) balance_amount
(D) StudentName
Answer:
(A) balanceAmount

Question 97.
……………. is not the example of camel case.
(A) balanceAmount
(B) StudentName
(C) balance_Amount
(D) All of these
Answer:
(C) balance_Amount

Question 98.
…………… is not a valid variable.
(A) balance
(B) Balance
(C) class
(D) date
Answer:
(C) class

Question 99.
……………. is not valid for the name of the class.
(A) CallCost
(B) Interest
(C) CalRange
(D) Area
Answer:
(C) CalRange

Question 100.
Traditionally for ……………. , first character is given in upper case.
(A) class
(B) variable
(C) camel case
(D) method
Answer:
(A) class

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 101.
Traditionally for……………. , first character is given in lower case.
(A) class
(B) variable
(C) method
(D) (B) and (C) both
Answer:
(D) (B) and (C) both

Question 102.
How many types of variables are there in Java ?
(A) 2
(B) 3
(C) 4
(D) 5
Answer:
(B) 3

Question 103.
…………….. is not a type of variable.
(A) Instance variable
(B) Class variable
(C) Camelcase variable
(D) Local variable
Answer:
(C) Camelcase variable

Question 104.
The function parameters declared in the function are called ……………… .
(A) instance variable
(B) class variable
(C) camelcase variable
(D) local variable
Answer:
(D) local variable

Question 105.
is the true syntax for declaring a variable.
(A) <type name> {variable [= <value>,]};
(B) <type name> {variable – names};
(C) (A) or (B)
(D) <type name> <variable – names>
Answer:
(C) (A) or (B)

Question 106.
The name given to the store the constant value is called …………….. .
(A) variable
(B) literal
(C) function
(D) parameter
Answer:
(B) literal

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 107.
What is a literal ?
(A) One data type of Java language.
(B) Name used to assign constant value
(C) Special word
(D) None of these
Answer:
(B) Name used to assign constant value

Question 108.
How many integer literals are there in Java – language ?
(A) 2
(B) 3
(C) 4
(D) 5
Answer:
(C) 4

Question 109.
……………… is the long decimal integer.
(A) 4L
(B) 2171
(C) (A) and (B) both
(D) 17777
Answer:
(C) (A) and (B) both

Question 110.
………………… is the true octal integer.
(A) 045
(B) 378l
(C) 729
(D) 439
Answer:
(A) 045

Question 111.
If numeric literal is preceded with …………….. then it becomes octal value.
(A) L
(B) l
(C) OX
(D) O
Answer:
(D) O

Question 112.
…………… is used to represent octal values.
(A) 0 to 7
(B) 1 to 8
(C) 8
(D) None of these
Answer:
(A) 0 to 7

Question 113.
……………. is used to represent hexadecimal values.
(A) 0 to 15
(B) 0 to 9 digit and characters A to F
(C) 16
(D) None of these
Answer:
(B) 0 to 9 digit and characters A to F

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 114.
…………… is used to precede the hexadecimal value in Java.
(A) Ox
(B) OX
(C) (A) or (B)
(D) Ob
Answer:
(C) (A) or (B)

Question 115.
…………….. is not the example of hexadecimal literal.
(A) Ox45
(B) OXFF7A
(C) O37
(D) OX35A
Answer:
(C) 037

Question 116.
…………….. is used to precede binary values in Java.
(A) Ob
(B) OB
(C) (A) or (B)
(D) OX
Answer:
(C) (A) or (B)

Question 117.
……………… type of integer is called literal.
(A) Octal
(B) Hexadecimal
(C) Binary
(D) Decimal
Answer:
(C) Binary

Question 118.
Real Number Literal is called …………….. .
(A) Floating Point Literal
(B) Real literal
(C) (A) or (B)
(D) None of these
Answer:
(A) Floating Point Literal

Question 119.
Floating Point Literal can be represented using …………….. method.
(A) standard
(B) scientific
(C) (A) and (B) both
(D) Unicode
Answer:
(C) (A) and (B) both

Question 120.
In the standard method, integer part and fractional part are separated using ……………… .
(A) .
(B) ;
(C) ,
(D) None of these
Answer:
(A) .

Question 121.
In the scientific method ……………. character is used.
(A) e
(B) E
(C) t
(D) (A) or (B)
Answer:
(D) (A) or (B)

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 122.
In the scientific value 1.3el2, ……………. represents the 10 exponent.
(A) 1.3
(B) el2
(C) .3e
(D) 1.3e
Answer:
(B) el2

Question 123.
What is the default type of floating point literal ?
(A) float
(B) double
(C) char
(D) short
Answer:
(B) double

Question 124.
If the literal is to be converted to float it is ended with ……………… .
(A) f
(B) F
(C) 0
(D) (A) or (B)
Answer:
(D) (A) or (B)

Question 125.
“1.2F” means ……………….. .
(A) 1.2 literal is of float type
(B) 1.2 literal is of double type
(C) it is a real number
(D) all of these
Answer:
(A) 1.2 literal is of float type

Question 126.
How many clear literals are there for Boolean ?
(A) 2
(B) 3
(C) only one
(D) 4
Answer:
(A) 2

Question 127.
……………. is not two about Boolean literal.
(A) There are true Boolean literals. : true and false
(B) Boolean literals are given in quotation signs.
(C) They are generally used in conditional expressions.
(D) All of these
Answer:
(B) Boolean literals are given in quotation signs.

Question 128.
Boolean values are not concerned with ……………….. value.
(A) character type
(B) any numeric value
(C) integer
(D) real
Answer:
(B) any numeric value

Question 129.
In C language, O is known as …………………. in Boolean type.
(A) true
(B) false
(C) zero
(D) constant value
Answer:
(B) false

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 130.
In C language, non zero value is known as …………… .
(A) true
(B) false
(C) zero
(D) constant value
Answer:
(A) true

Question 131.
……………… is not the example of character literal.
(A) ‘S’
(B) ‘#’
(C) “SAN”
(D) ‘3’
Answer:
(C) “SAN”

Question 132.
In character literal, character is stored using ……………… bits Unicode.
(A) 4
(B) 8
(C) 16
(D) 32
Answer:
(C) 16

Question 133.
In character literal, ………………. is used as escape character.
(A) / (forward slash)
(B) \(back slash)
(C) escape key
(D) \\(double back slash)
Answer:
(B) \(back slash)

Question 134.
Match the following pairs.

Escape code Meaning
(1) \n (i) Carnage return
(2) \t (ii) Backspace
(3) \b (iii) Tab
(4) \r (iv) New line

(A)(1 → iv),(2 → iii),(3 → iv),(4 → i)
(B) (1 → iv), (2 → iii), (3 → ii), (4 → i)
(C) (1 → iv), (2 → iii), (3 → i), (4 → ii)
(D) (1 → ii), (2 → iii), (3 → i), (4 → iv)
Answer:
(B) (1 → iv), (2 → iii), (3 → ii), (4 → i)

Escape code Meaning
(1) \n (iv) New line
(2) \t (iii) Tab
(3) \b (ii) Backspace
(4) \r (i) Carnage return

Question 135.
……………… indicates the three octal numbers character literal.
(A) \xdd
(B) \ddd
(C) \udddd
(D) \ud
Answer:
(B) \ddd

Question 136.
…………….. indicates the two hexadecimal numbers in character literal.
(A) \ddd
(B) \xdd
(C) \udddd
(D) \udd
Answer:
(B) \xdd

Question 137.
…………….. indicates the Unicode number in character literal.
(A) \ddd
(B) \xdd
(C) \udddd
(D) \ud
Answer:
(C) \udddd

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 138.
What is a string literal ?
(A) A sequence of characters
(B) Characters enclosed in double quotes
(C) Group of characters and digits
(D) All of these
Answer:
(B) Characters enclosed in double quotes

Question 139.
To display Many “Congratulation!”, ……………… can be given in Java program.
(A) “Many Congratulations”
(B) “Many, congratulations”
(C) “Many, \Congratulations!\”
(D) “Many, \”Congratulations!\””
Answer:
(D) “Many, \”Congratulations!\””

Question 140.
Comments are of ……………. type in Java.
(A) 3
(B) 4
(C) 2
(D) many
Answer:
(A) 3

Question 141.
…………… is true about comment line.
(A) Comment line is only for readers
(B) Computer ignores the comments
(C) It makes the program easy to understand
(D) All of these
Answer:
(D) All of these

Question 142.
………………. is used to mention one line comment.
(A) /
(B) //
(C) \
(D) \\
Answer:
(B) //

Question 143.
……………. is used to mention multiline comment.
(A) //
(B) /* and */
(C) /** to*/
(D) *
Answer:
(B) /* and */

Question 144.
………… can to be done in comment line.
(A) Nesting
(B) Comment within another comment
(C) (A) or (B)
(D) Comment line can not be written
Answer:
(C) (A) or (B)

Question 145.
……………. is used to mention documentation comment.
(A) / * and * /
(B) /** and */
(C) *
(D) //
Answer:
(B) /** and */

Question 146.
What is the use of documentation comment ?
(A) To write a paragraph
(B) To make ASL documentation from its code
(C) To make API documentation from its code
(D) Not possible
Answer:
(C) To make API documentation from its code

Question 147.
……………. comment line can be given in Java.
(A) Documentation comment
(B) Multiline comment
(C) Single line comment
(D) All of these
Answer:
(A) Documentation comment

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 148.
How many arithmetic operators are there in Java ?
(A) 2
(B) 3
(C) 4
(D) 5
Answer:
(D) 5

Question 149.
How are the basic arithmetic operators in Java ?
(A) Binary
(B) Octal
(C) Hexadecimal
(D) Decimal
Answer:
(A) Binary

Question 150.
……………….. can also be used only with one operand.
(A) +
(B) –
(C) *
(D) (A) and (B) both
Answer:
(D) (A) and (B) both

Question 151.
In which data type value is counted as per Unicode number ?
(A) Integer
(B) char
(C) double
(D) float
Answer:
(B) char

Question 152.
8 % 3 will give ……………. output.
(A) 1
(B) 2
(C) 3
(D) 4
Answer:
(B) 2

Question 153.
25.8 % 7 will give ……………….. output.
(A) 3
(B) 4.8
(C) 4
(D) 5
Answer:
(B) 4.8

Question 154.
x = 6;
y = 4;
x % y;
will give …………….. output.
Answer:
(A) 1
(B) 2
(C) 0
(D) 3
Answer:
(B) 2

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 155.
x = 6;
‘ a = 12.5;
a % x;
will give ……………. output.
(A) 2
(B) 1
(C) 0.5
(D) 0
Answer:
(C) 0.5

Question 156.
a = 12.5;
b = 7.2;
a % b;
will give ……………. output.
(A) 1
(B) 5.3
(C) 0.3
(D) 6
Answer:
(B) 5.3

Question 157.
x = 10;
y = 4+ ++x;
then x = …………….. and y = ……………..
(A) 10, 14
(B) 11, 15
(C) 11, 14
(D) 10, 11
Answer:
(B) 11, 15

Question 158.
x = 10;
y = 4 + x ++;
then x = ……………. and y = …………..
(A) 14, 11
(B) 14, 10
(C) 11, 15
(D) 10, 14
Answer:
(A) 14, 11

Question 159.
How many comparison operators are there in Java ?
(A) 5
(B) 6
(C) 4
(D) 3
Answer:
(B) 6

Question 160.
………………. is not the comparison operator.
(A) >
(B) <
(C) %
(D) ! =
Answer:
(C) %

Question 161.
What is the use of comparison operator ?
(A) To make mathematical process
(B) To compare values of integer type and char type
(C) (A) and (B) both
(D) There is no operator like this in Java.
Answer:
(B) To compare values of integer type and char type

Question 162.
……………. is used to get Boolean result of an expression.
(A) Comparison Operator
(B) Arithmetic Operator
(C) Logical Operator
(D) Conditional Operator
Answer:
(A) Comparison Operator

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 163.
Comparison Operator give ……………. result.
(A) Numbered
(B) Boolean
(C) 0
(D) > 0
Answer:
(B) Boolean

Question 164.
………….. comparison operators are used to get compare Boolean values.
(A) < and >
(B) < = and > =
(C) = = and ! –
(D) All of these
Answer:
(C) = = and ! –

Question 165.
Comparison operators are used in ………………… condition statements.
(A) while and loop
(B) do…while and loop
(C) if statement and loop
(D) For statement and loop
Answer:
(C) if statement and loop

Question 166.
How many logical operators are there in Java ?
(A) 3
(B) 4
(C) 5
(D) 2
Answer:
(B) 4

Question 167.
Logical operators are known as …………….. .
(A) boolean operator
(B) comparison operator
(C) arithmetic operator
(D) conditional operator
Answer:
(A) boolean operator

Question 168.
…………….. is not the logical operator.
(A) AND
(B) XOR
(C) OR
(D) EOF
Answer:
(D) EOF

Question 169.
To join two boolean values for logical AND, ……………. operator is used.
(A) &&
(B) ||
(C) ∧
(D) !
Answer:
(A) &&

Question 170.
Match the following pairs.

Escape code Meaning
(1) AND (i) ∧
(2) OR (ii) ||
(3) XOR (iii) !
(4) NOT (iv) &&

(A) (1 → iv), (2 → ii), (3 → iii), (4 → i)
(B) (1 → iv), (2 → iii), (3 → ii), (4 → i)
(C) (1 → iv), (2 → ii), (3 → i), (4 → iii)
(D) (1 → ii), (2 → iii), (3 → i), (4 → iv)
Answer:
(C) (1 → iv), (2 → ii), (3 → i), (4 → iii)

Escape code Meaning
(1) AND (iv) &&
(2) OR (ii) ||
(3) XOR (i) ∧
(4) NOT (iii) !

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 171.
……………. is a unary operator.
(A) AND
(B) OR
(C) NOT
(D) XOR
Answer:
(C) NOT

Question 172.
…………….. is used for XOR (exclusive OR).
(A) ∧
(B) !
(C) ||
(D) &&
Answer:
(A) ∧

Question 173.
What will be the output of (x = = 0) ∧ (y = = 0) ?
(A) true
(B) false
(C) error
(D) No output
Answer:
(A) true

Question 174.
What will be the output of (x = = 0) ∧ (x = = 0) ?
(A) true
(B) false
(C) error
(D) No output
Answer:
(B) false

Question 175.
…………….. is the conditional operator.
(A) Unary Operator
(B) Ternary Operator
(C) Bemary Operator
(D) None of these
Answer:
(B) Ternary Operator

Question 176.
How many operands are there in conditional operator ?
(A) 2
(B) 3
(C) 4
(D) Only one
Answer:
(B) 3

Question 177.
symbol suggests the ternary operator.
(A) ? and :
(B) ? and ;
(C) ? and ,
(D) ; and ?
Answer:
(A) ? and :

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 178.
…………………….. is the syntax of ternary Operator.
(A) <boolean – expression>:
<expression1>:<expression2>
(B) <boolean – expression?
<expression1>; <expression2>
(C) cboolean – expression>?
<expression1>:<expression2>
(D) <boolean – expression>:
<expression1>?<expression2>
Answer:
(C) cboolean – expression>?
<expression1>:<expression2>

Question 179.
N = 8;
next = (N%2==0) ? (N/2) : (3 * N + 1);
What will be the value of next ?
(A) 25
(B) 4
(C) 13
(D) 0
Answer:
(B) 4

Question 180.
N = 9;
next = (N%2==0) ? (N/2) : (3 * N + 1);
What will be the value of next ?
(A) 4
(B) 4.5
(C) 28
(D) 0
Answer:
(C) 28

Question 181.
………………. is called the assignment operator.
(A) =
(B) = =
(C) ! =
(D) = !
Answer:
(A) =

Question 182.
…………….. is the form of assignment statement.
(A) <variable> = <expression>;
(B) <variable> = (expression);
(C) <variable> : <expression);
(D) (variable) = (expression);
Answer:
(A) <variable> = <expression>;

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 183.
The left side variable of assignment operator is called …………… .
(A) Rvalue
(B) mvalue
(C) lvalue
(D) None of these
Answer:
(C) lvalue

Question 184.
In assignment statement ……………. indicates the memory location.
(A) Left side variable of statement
(B) Right side variable of statement
(C) (A) and (B) both
(D) None of these
Answer:
(A) Left side variable of statement

Question 185.
If there is higher data type for the left side variable in assignment statement, what will be the output ?
(A) 0
(B) Shows error due to precision problem
(C) 1
(D) Output will be > 1
Answer:
(B) Shows error due to precision problem

Question 186.
What is the meaning of short hand operator a + = b ?
(A) a + b = b
(B) a + b = a
(C) a = a + b
(D) b = a + b
Answer:
(C) a = a + b

Question 187.
What is the meaning of short hand operator q&& = p ?
(A) q = q&&p
(B) q&&p = q
(C) p = q&&p
(D) p&&q = p
Answer:
(A) q = q&&p

Question 188.
Changing of data type during the cause of the program is called ………………..
(A) data change
(B) Type-cast
(C) change data
(D) None of these
Answer:
(B) Type-cast

Question 189.
What is the format of typecast ?
(A) (<data-type>) <expression>
(B) (datatype) (expression)
(C) data <expression>
(D) <datatype> <expression>
Answer:
(A) (<data-type>) <expression>

Question 190.
If two operators have same precedence in a statement, then calculation is called as per ………………. .
(A) associativity
(B) from left to right
(C) (A) or (B)
(D) none of these
Answer:
(C) (A) or (B)

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 191.
In most of the cases associativity is on ……………… side.
(A) right to left
(B) left to right
(C) no side is fixed
(D) none of these
Answer:
(B) left to right

Question 192.
In unary operations the associativity is on ……………… side.
(A) right to left
(B) left to right
(C) no side is fixed
(D) none of these
Answer:
(A) right to left

Question 193.
In conditional operations the associativity is on …………….. side.
(A) right to left
(B) left to right
(C) no side is fixed
(D) none of these
Answer:
(A) right to left

Question 194.
The statements which control the flow of execution of statements in Java is called ……………….. .
(A) conditional structures
(B) control structures
(C) (A) or (B)
(D) definite structures
Answer:
(C) (A) or (B)

Question 195.
What type of control structures are there in Java ?
(A) loops
(B) branches
(C) (A) and (B) both
(D) Tree
Answer:
(C) (A) and (B) both

Question 196.
The repetition of the statements till the condition is satisfied is called ………………. .
(A) loops
(B) branches
(C) (A) and (B) both
(D) Tree
Answer:
(A) loops

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 197.
Branches are used to choose among two or more possible courses of action, so also called …………….. .
(A) loops
(B) branches
(C) selective structure
(D) (B) or (C)
Answer:
(D) (B) or (C)

Question 198.
Control structure “Branches” can also be called ……………….. .
(A) loops
(B) selective structure
(C) (A) or (B)
(D) Tree
Answer:
(B) selective structure

Question 199.
Control structures that are used to determine the normal flow of control in a program are …………….. .
(A) if statement
(B) switch statement
(C) while loop, do…while loop and for loop
(D) all of these
Answer:
(D) all of these

Question 200.
Block statements are written within ………………. brackets.
(A) “[” and “]”
(B) “{” and “}”
(C) “(“and “)”
(D) “<” and “>”
Answer:
(B) “{” and “}”

Question 201.
What is the format of block in Java ?
(A) [
<statements>
]
(B) (
<statements>
)
(C) {
<statements>
}
(D) <
statements;
>
Answer:
(C) {
<statements>
}

Question 202.
Which sentence is true for using a block ?
(A) To group a sequence of statements into a single unit
(B) To group logically related statements
(C) To creator variables with local scope for statements within a block
(D) All of these
Answer:
(D) All of these

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 203.
If another variable declared with same name within the scope of another variable then ………………. .
will be there in the output.
(A) value assigned first time to the variable is given in the output.
(B) value assigned second(last) time to the variable is given in the output.
(C) error occurs.
(D) program moves to the infinity mode.
Answer:
(C) error occurs.

Question 204.
Statement is the example of ………………… control structure.
(A) branching
(B) decision
(C) selective
(D) all of these
Answer:
(D) all of these

Question 205.
nested ……………… if means …………… .
(A) if statement within another if statement
(B) series of if statement
(C) series of compound if statement
(D) none of these
Answer:
(A) if statement within another if statement

Question 206.
If different types of tasks are there based on different values of a variable or the expression then ………………… should be used.
(A) if statement
(B) for statement
(C) switch statement
(D) all of these
Answer:
(C) switch statement

Question 207.
In the switch-statement what should be the type of test expression ?
(A) byte
(B) short or int
(C) char
(D) All of these
Answer:
(D) All of these

Question 208.
If no match is found for any case in the switch statement, then ……………… is executed.
(A) statementl gets executed.
(B) default gets executed.
(C) nothing is executed.
(D) (B) or (C)
Answer:
(D) (B) or (C)

Question 209.
What is the use of break in switch statement ?
(A) To move from one case to the other.
(B) To terminate switch statement
(C) To terminate switch statement and move to the first statement again
(D) (B) or (C)
Answer:
(D) (B) or (C)

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 210.
How many looping structures are there in Java ?
(A) 3
(B) 4
(C) only one
(D) 2
Answer:
(A) 3

Question 211.
Which is the pre-test loop ?
(A) for
(B) while
(C) (A) and (B) both
(D) do…while
Answer:
(C) (A) and (B) both

Question 212.
If the iterations are pre defined then what loop should be used ?
(A) while
(B) for
(C) switch
(D) do…while
Answer:
(B) for

Question 213.
How many expressions are there in for loop ?
(A) 2
(B) 3
(C) 4
(D) only one
Answer:
(B) 3

Question 214.
When will for (; 😉 enter the infinite loop ?
(A) If there is no control statement in for statement
(B) If break statement is not executed
(C) (A) or (B)
(D) This is not possible
Answer:
(C) (A) or (B)

Question 215.
In ……………. loop, statements are executed first then condition is checked.
(A) for
(B) while
(C) do…while
(D) switch
Answer:
(C) do…while

Question 216.
Which is the post-test statement ?
(A) for
(B) while
(C) do…while
(D) switch
Answer:
(C) do…while

Question 217.
In ……………… loop, statements are executed at least once.
(A) do…while
(B) while
(C) switch
(D) for
Answer:
(A) do…while

GSEB Std 12 Computer MCQ Answers Ch 7 Java Basics

Question 218.
……………. statement is used to change the control of program outside switch or loop.
(A) continue
(B) stop
(C) break
(D) exit
Answer:
(C) break

Question 219.
If we use break statement within loop of switch statement what happens ?
(A) The remaining statements are not executed
(B) Control returns to the first statement again
(C) (A) and (B) both
(D) Nothing will happen
Answer:
(C) (A) and (B) both

Question 220.
……………… is used to exit the loop.
(A) stop
(B) exit
(C) continue
(D) break
Answer:
(D) break

Question 221.
When break statement is used in a loop, ………………
(A) the statements are left without execution
(B) no extra repetition is done
(C) program control returns to the first statement
(D) all of these
Answer:
(D) all of these

Question 222.
In ……………… statement the remaining statements are not executed and program control returns to the first statement again.
(A) continue
(B) break
(C) stop
(D) exit
Answer:
(A) continue

 

Leave a Comment

Your email address will not be published. Required fields are marked *