Home / HSC(ENG) - GSEB Board / Reading Mode

๐Ÿ“– Reading Mode: HSC(ENG) - GSEB Board

Chapter: Java Basics โ€ข Total: 280 MCQs

MCQ 1 Data types

What is an international standerd for defining real numbers in java ?

A IEEE654
B IEEE555
C IEEE754
D IEEE455
MCQ 2 Data types

Which of the following determines the required memory size, type of value, range of values and types of operations that can performed?

A Variable
B Literal
C Comment
D Data types
MCQ 3 Associativity

Which of the following operators have no right-to-left associativity?

A &&
B ?:
C +=
D --
MCQ 4 Variables

Which of the following words is not a reserved word?

A while
B $price
C static
D class
MCQ 5 Use of brake and continue statement

Which statement is used to transfer the control outside switch or loop structure?

A Continue
B Break
C Go
D if ย 
MCQ 6 Short circuiting

In short-circuiting,in which case if first opened is false, ย there is no need to evaluate second operand ?

A ||
B &&
C ?:
D *=
MCQ 7 Operators

what will be the result of arithmetic expection โ€“12.5%7.2?

A 5.3
B 5
C -5.3
D -5
MCQ 8 String literals

The Unicode sequence u2122 produces what type of symbol?

A TM
B ยฎ
C ยฉ
D @
MCQ 9 Literals

THE NAME USED FOR A CONSTANT VALUE IS KNOWN AS WHAT IN JAVA.

A STRING
B ARRAY
C LITERAL
D CLASS
MCQ 10 Creating simple of java application

WHEN JAVA PROGRAM CREATED JAVA SOURCE FILE USING TEXT EDITOR,WHICH FILE EXTENSION SHOULD BE GIVEN.

A .CLASS
B .HTML
C .JPG
D .JAVA
MCQ 11 The process of compiling and executing a java application

WHICH OPREATOR CAN BE USED TO CONCATENATE A STRING IN JAVA.

A =
B +
C &
D *
MCQ 12 Data types

WHAT IS THE DEFAULT VALUE OF BOOLEAN DATA TYPE OF JAVA.

A FALSE
B TRUE
C O (ZERO)
D 1
MCQ 13 Comments

WHICH SIGN INDICATES SINGLE LINE COMMENT IN JAVA?

A /* AND ENDS WITH */
B /** AND ENDS WITH */
C //
D #
MCQ 14 Rules to define variables

FROM THE FOLLOWING WHICH IS THE ILLEGAL NAME OF VARIABLE IN JAVA?

A 4ME
B RESULT
C AMOUNT$
D PRICE$
MCQ 15 The process of compiling and executing a java application

WHICH COMMAND IS USED TO COMPILE SOURCE PROGRAM IN SCITE?

A EDIT-COMPILE
B FROMAT-COMPILE
C TOOLS - COMPILE
D FILE-COMPILE
MCQ 16 Operators

FROM THE FOLLOWING WHICH IS NOT A COMPARISON OPREATOR IN JAVA?

A >
B <
C <=
D +
MCQ 17 Introduction of java

JAVA LANGUAGE WAS DEVELOPED BY WHOM?

A SUN MICROSYSTEM
B ORACLE
C NETSCAPE
D MICROSOFT
MCQ 18 Java virtual machine(JVM)

WHAT IS THE FULL FORM OF JVM?

A JAVA VISIBILITY MODIFIER
B JAVA VISUAL MODEM
C JAVA VIRTUAL MACHINE
D JAVA VISUAL MACHINE
MCQ 19 Introduction of java

In Java, a block statement is a group of statements enclosed between which bracket ?

A < >
B ( )
C [ ]
D { }
MCQ 20 Data types

What is the value of float data type in Java ?

A Boolean
B Character
C Integer
D Real
MCQ 21 Conditional operator

How many types of control structures are there in Java ? Which ?

A 3. Loops, Branches, Functions
B 2. Function & Method
C 3. for, while, do,while
D 2. Loops, Branches
MCQ 22 Introduction of java

Java supports how many basic (primitive) data types ?

A 8
B 2
C 4
D 6
MCQ 23 Introduction of java

Which symbol is used for Assignment operator in Java ?

A #
B $
C ?
D =
MCQ 24 Introduction of java

In Java, which statement is used when there are many alternative actions to be taken depending upon the value of a variable or expression ?

A Control
B Switch
C Repeat
D Nested if
MCQ 25 Introduction of java

Which numeric digits are used for Hexadecimal numbers (16 digits) in integer literals in Java ?

A 0 to 8
B 0 to 9
C 0 to 15
D 0 to 16
MCQ 26 Introduction of java

What will be the result of arithmetic expression 7/2, 7%2, -7.5%2 ?

A 3, 3.5, -3
B 3.5, 1, -1.5
C 3.5, 3, -1.5
D 3, 1, -1.5
MCQ 27 Introduction of java

In Java, String literals is a sequence of characters and its enclosed in which symbol ?

A (single quotes)
B " " (Double quotes)
C ? ?
D { }
MCQ 28 Introduction of java

In Java, the machine language for Java Virtual Machine is known as which code ?

A Java codebyte
B Java filecode
C Java bytecode
D Java codefile
MCQ 29 Introduction of java

In Java, for boolean data type there are precisely two literals, which are they ?

A True and False
B 0 and 1
C Y and N
D Yes and No
MCQ 30 Introduction of java

In SciTE editor, which menu - option is used if the program is compiled without any error ?

A Format - Go
B File - Go
C Edit - Go
D Tools - Go
MCQ 31 Introduction of java

In SciTE editor, which menu - option is used to compile java source program ?

A Format - Compile
B File - Compile
C Edit - Compile
D Tools - Compile
MCQ 32 Introduction of java

To use a labeled loop, which symbol is added before the loop ?

A $
B *
C :
D #
MCQ 33 Introduction of java

In Java, Characters literals are stored by how many bit Unicode characters ?

A 16-bit
B 8-bit
C 4-bit
D 32-bit
MCQ 34 Data types

What is the storage space for data type float in Java ?

A 16 bytes
B 8 bytes
C 4 bytes
D 2 bytes
MCQ 35 Introduction of java

Which symbol is used for Logical operator AND, OR, NOT, XOR in Java ?

A &&, !, |, ^
B &&, ||, !, ^
C &, |, !, ^
D &&, !, ||, ^
MCQ 36 Introduction of java

What is the default data type of floating point literal ?

A long
B float
C double
D int
MCQ 37 Introduction of java

To compile the java program we have to type what in front of source file name ?

A java filename.java
B javac filename
C javac filename.class
D javac filename.java
MCQ 38 Variables

A name used to refer to the data stored in memory is called what ?

A Variable
B Object
C Value
D Function
MCQ 39 Introduction of java

In Java, which of the following is illegal way to define variable name ?

A %discount
B 4me
C All of these
D birth date
MCQ 40 Introduction of java

Which of the following data type is used for real numbers ?

A boolean
B byte, short, int, long
C float, double
D char
MCQ 41 Introduction of java

In Java, variable name should begin with which of the following ?

A Underscore (_)
B All of these
C Alphabet
D Dollar sign ($)
MCQ 42 Introduction of java

Which of the following is Increment and Decrement operator in Java ?

A =+ and =-
B =- and =+
C ++ and --
D + and -
MCQ 43 Introduction of java

Which operator can be used to concatenate a string in Java ?

A &
B +
C *
D =
MCQ 44 Introduction of java

What kind of the primitive data types are provided in Java from the following ?

A All of these
B byte, short, int, long
C char, boolean
D float, double
MCQ 45 Introduction of java

Which of the following editor is used to create Java file in Ubuntu ?

A Calc
B SciTE
C Writer
D Gedit
MCQ 46 Introduction of java

Which of the following Escape code is used for backspace in Java ?

A 
B s
C f
D s
MCQ 47 Introduction of java

In Java, which statement is used to exit from the loop ?

A stop
B exit
C break
D out
MCQ 48 Introduction of java

In Java, which of the following is legal way to define variable name ?

A All of these
B CallCost, top5students
C birth_date, result
D date, amount$, $price
MCQ 49 Introduction of java

In Java, which statement is used to skip the following statements in a loop and continue with the next iteration ?

A break
B continue
C go
D run
MCQ 50 Introduction of java

When the program gets compiled without error, compiler creates a file with which extension ?

A .java
B .class
C .txt
D .jar
MCQ 51 Introduction of java

In Java, which statement is used to transfer the control outside switch or loop structure ?

A break
B loop
C continue
D go
MCQ 52 Introduction of java

In Java, which of the following is not allowed as first character in valid variable name ?

A Underscore (_)
B Alphabet
C Dollar sign ($)
D Digit
MCQ 53 Introduction of java

In Java, which option indicates Single line, Multi-line and API Documentation comment ?

A //, /* .. /, /**.. */
B //, /* .. */, /* .. *//
C //, /* .. */, /** .. */
D //, // .. //, /** .. */
MCQ 54 Introduction of java

Which two symbols are used for Conditional operator in Java ?

A ?;
B ;?
C ?:
D :?
MCQ 55 Introduction of java

Which of the following is considered as comparison operator in Java ?

A #
B =!
C =
D !=
MCQ 56 Introduction of java

What is the extension of Java Source file ?

A .obj
B .java
C .jar
D .src
MCQ 57 Introduction of java

Which of the following is a Comparison operator in Java ?

A AND, OR, NOT, XOR
B ==, !=, <, >, >=, <=
C ++, --
D ?:
MCQ 58 Introduction of java

Which character set is used for char data type in Java ?

A ASCII
B EBCIDIC
C All of these
D Unicode
MCQ 59 Introduction of java

Which of the following is Entry-controlled or Pre-test loop constructs in Java ?

A for and while
B while
C for
D do while
MCQ 60 Introduction of java

In Java program, which methods are used to display results ?

A System.out.println()
B System.out.print()
C System.print.display()
D System.out.print() and System.out.println()
MCQ 61 Introduction of java

Who developed Java language ?

A Sun Microware
B Sun Microsystems
C Sun Microsource
D Sun Microsoft
MCQ 62 Introduction of java

What is known as when programs written in Java are compiled into machine language for a computer that doesnt really exist ?

A Java Visible Machine
B Java Verified Machine
C Java Virtual Machine
D Option 4
MCQ 63 Introduction of java

In Java, which of the following is used to repeat a sequence of statements over and over until some condition occurs ?

A Loops
B Repeats
C Branches
D Breaks
MCQ 64 Introduction of java

In Java, what is the default value of Boolean data type ?

A TRUE
B 1
C 0
D FALSE
MCQ 65 Introduction of java

In Java, a name used for constant value is known as what ?

A Function
B Operator
C Literal
D Variable
MCQ 66 Java virtual machine(JVM)

By using which extension file java interpreter byte code executes ?

A .txt
B .java
C .class
D .html
MCQ 67 Introduction of java

From the following which is not compiled or interpreted in Java ?

A Comment
B Function
C Variable
D Method
MCQ 68 Introduction of java

Which of the following is Exit controlled or Post-test loop constructs in Java ?

A while
B do while
C for
D for and while
MCQ 69 Introduction of java

Which of the following variable name is not valid in Java?

A _marks
B 4subject
C total_marks
D $age
MCQ 70 Introduction of java

Which of the following statement is used to transfer the control outside Switch or Loop construct?

A continue
B else
C end
D break
MCQ 71 Introduction of java

Which of the following is used to repeat a sequence of statements over and over until some condition occurs?

A block
B array
C loops
D boolean
MCQ 72 Introduction of java

What is it called when ++ operator is used after variable name in Java?

A post increment
B pre increment
C increment pre
D pre decrement
MCQ 73 Introduction of java

What will be the result of arithmetic experssin 9%2 ?

A 4.5
B 1
C 4
D 0
MCQ 74 Introduction of java

Single line comment begins with which sign in Java?

A /*
B /**
C //
D ALL
MCQ 75 Introduction of java

Which of the following is not a proper example of Hexa decimal number?

A OXFF7A
B OX39A2
C OX39A2
D OABC
MCQ 76 Introduction of java

Which logical operator returns true only if its operands are different (one true and one false) and false otherwise?

A XOR
B OR
C AND
D NOT
MCQ 77 Introduction of java

Which of the following is a proper option for the statement โ€œIs A not equal to Bโ€?

A A <> B
B A โ‰  B
C A NOT B
D A!= B
MCQ 78 Introduction of java

When a variable is declared inside a block, what is it called?

A Global
B Local
C Label
D Repetitive
MCQ 79 Introduction of java

If a=12.5 and b=7.2, then after executing a%b, what will be the remainder?

A 1
B 5.3
C 5
D 1.22
MCQ 80 Introduction of java

In switch statement, if no match is found between test expression and case values, then which statement will be executed?

A break
B continue
C ifโ€ฆelse
D default
MCQ 81 Introduction of java

If the conditional ternary is (N%2==0)?(N/2):(3*N+1); where N=7 then what will be the value of variable next?

A 22
B 7
C 3.5
D 0
MCQ 82 Introduction of java

What sign is used for creating API documentation from the code ?

A //
B /*
C */
D /**
MCQ 83 Introduction of java

Which of the following is compiled error free?

A for(;;){int i=7};
B while (1) { int i=7};
C while (true){int i=7}
D All of these
MCQ 84 Introduction of java

In Java, Which of the following looping is exit controlled?

A for
B while
C do..while
D All of these
MCQ 85 Introduction of java

What kind of primitive data types are provided in Java from the following?

A boolean
B double
C char
D All of these
MCQ 86 Introduction of java

While creating Java what must be the same ?

A folder name, filename
B class name, extension
C class name, folder name
D class name, file name
MCQ 87 Introduction of java

When the program gets compiled without error, compiler creates a file with which extension ?

A .comp
B .txt
C .java
D .class
MCQ 88 Introduction of java

Which of the following is right way to define variable ?

A $age
B discount rate
C 4you
D %discount
MCQ 89 Introduction of java

String literals is a sequence of characters enclosed in which quotes ?

A Single(' ')
B Double(" ")
C { }
D ( )
MCQ 90 Introduction of java

Which of the two symbols are used in the conditional operator in Java ?

A : and *
B # and ?
C ? and :
D / and ?
MCQ 91 Introduction of java

While using shorthand version of assignment, it is defined as a+=b where a is 7 and b is 8 then what will result of a ?

A 8
B 49
C 14
D 15
MCQ 92 Introduction of java

When two operators are having different priority, then an operator with higher precedence is operate________

A first
B last
C second
D middle
MCQ 93 Introduction of java

Control structure branches are used to choose among two or more possible courses of action, is called as what ?

A More structure
B Loop structure
C Addition structure
D Selective structure
MCQ 94 Introduction of java

Switch statement can be stopped using which statement ?

A break
B run
C continue
D error
MCQ 95 Introduction of java

do โ€ฆ.. while loop is which type of loop ?

A Loop controlled
B Break controlled
C Exit controlled
D Entry controlled
MCQ 96 Introduction of java

To use a labeled loop, which symbol is added before the loop?

A *
B $
C :
D @
MCQ 97 Introduction of java

in java, the text written in /*โ€ฆ.*/ is considered as what ?

A Method
B Class
C Comment
D All of these
MCQ 98 Introduction of java

user can create Java source file by using ____________ application?

A Scite Editor
B ASCII text editor
C Both (A) & (B)
D None of these
MCQ 99 Introduction of java

The definition of the method (function) in java consists of function head and the sequence of statement enclosed in which bracket?

A <>
B { }
C ( )
D All of these
MCQ 100 Introduction of java

Which extension is used to source file of java language, written in a text editor?

A .class
B .html
C .java
D .jpg
MCQ 101 Introduction of java

From the following which methods are used to display results?

A System.out.print()
B System.out.println()
C Both (A) & (B)
D System.out.display()
MCQ 102 Introduction of java

In java, the program is compiled without any error, which command is used to execute it?

A Tools -> Go
B Tools -> Run
C Tools -> Build
D Tools -> Compile
MCQ 103 Introduction of java

From the following which are the examples of reserved words in Java?

A class
B public
C static
D All of these
MCQ 104 Introduction of java

A name used for a constant value is known as what in Java ?

A String
B Array
C Literal
D Class
MCQ 105 Introduction of java

From the following which is not logical operator in Java?

A And
B Or
C Not
D Equal
MCQ 106 Introduction of java

In java, at which level platform โ€“independence is possible due to bytecode interpreter?

A browser
B source
C machine
D binary
MCQ 107 Introduction of java

in Java, the machine language for Java Virtual Machine is known as which code?

A java filecode
B java bytecode
C java intcode
D java sourcecode
MCQ 108 Introduction of java

What is the storage space for datatype float in java?

A 1 Byte
B 2 Byte
C 4 Byte
D 8 Byte
MCQ 109 Introduction of java

Real numbers in Java are compliant with which of the following?

A IEEE 123
B IEEE 120
C IEEE 754
D IEEE 780
MCQ 110 Introduction of java

In java, variable name should begin with which of the following?

A Albhabet
B Underscore
C Dollar
D All of these
MCQ 111 Introduction of java

Java 7 also supports binary numbers, using digits 0 and 1 but it should be prefix by which of the following?

A 0b or 0B
B B
C b
D b0
MCQ 112 Introduction of java

In java, for type boolean there are precisely two literals, which are they?

A Y or N
B 0 and 1
C True and False
D Yes Or No
MCQ 113 Introduction of java

Arithmetic operators in java, can be applied on which numeric data?

A short
B float
C double
D All of these
MCQ 114 Introduction of java

Which of the following is considered as comparison operator in Java?

A =
B /
C %
D !=
MCQ 115 Introduction of java

In java,logical operators are also called which of the following operators if they operate on Boolean operands?

A assignment operator
B Boolean operator
C Increment operator
D Relational operator
MCQ 116 Introduction of java

Java language was developed by whom?

A Sun Microsystem
B Oracle
C Netscape
D Microsoft
MCQ 117 Introduction of java

Which of the Java syntax is very similar to which language?

A Python
B C
C Java Script
D All of these
MCQ 118 Introduction of java

The alphabet D in JDK stands for which of the following?

A Department
B Development
C Design
D Desktop
MCQ 119 Introduction of java

In Java, which of the following is same as q && = p?

A q = qp
B q=q-p
C q=q+p
D q=q && p
MCQ 120 Introduction of java

In Java, which logical operator results in complemented result?

A NOT
B AND
C OR
D XOR
MCQ 121 Introduction of java

In Java, which escape code represents โ€˜carriage returnโ€™?

A \n
B \r
C \t
D \f
MCQ 122 Introduction of java

In Java, which of the following is an invalid variable name?

A totalAmount
B birth Date
C $price
D top5students
MCQ 123 Introduction of java

In Java, in switch statement, which of the following statements will be executed, when no match is found?

A break
B default
C continue
D exit
MCQ 124 Introduction of java

In Java, what will be the value of variable next, where next (N%2==0)? (N/2): (3*N+1); and N is 9?

A 4.5
B 9
C 28
D Error
MCQ 125 Introduction of java

In Java, which of the following 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 Switch statement
B For loop
C While loop
D If-statement
MCQ 126 Introduction of java

In Java, which of the following is a correct syntax of do... while loop?

A do {statements} (exp);
B do (exp) {statements} (while);
C do (expl; exp2; exp3) {statements};
D do (exp) {statement1} while {statement2};
MCQ 127 Introduction of java

In Jaya, which of the following determines the, required memory size, type of values, range of values and type of operations that can be performed?

A Variables
B Data types
C Comments
D Arithmetic operators
MCQ 128 Introduction of java

Which of the following commands is used to compile the Java program?

A run
B execute
C javac
D java
MCQ 129 Introduction of java

Which language is considered as one of the ideal language for distributing executable programs via the World Wide Web?

A CSS
B HTML
C JavaScript
D Java
MCQ 130 Introduction of java

In Java, which of the following determines the required memory size, type of values, range of values and type of operations that can be performed?

A Data Types
B Operators
C Comments
D Literals
MCQ 131 Introduction of java

Which of the following is a valid variable name in Java?

A 4me
B birth date
C date
D %discount
MCQ 132 Introduction of java

In the structure of Java program, what is used as a place holder?

A Text in <> brackets
B Text in { } brackets
C Text in ( ) brackets
D Text in [ ] brackets
MCQ 133 Introduction of java

Which type of Java comment is usually used to have more than one line as comments?

A Single-line comment
B Keyword comment
C Multi-level comment
D Multi-line comment
MCQ 134 Introduction of java

In Java, which of the following syntax is used to declare a variable?

A {type-name};
B {variable-names };
C ;
D ;
MCQ 135 Introduction of java

In the conditional operator of Java, which symbols are used in the expression to delimit three operands?

A ?:
B +$
C #$
D #%
MCQ 136 Introduction of java

In Java, which of the following is a valid example of octal number?

A "037"
B 0x2A
C -59
D \400E9
MCQ 137 Introduction of java

In Java, what are used to choose among two or more possible courses of action?

A Loops
B Variables
C Class
D Branches
MCQ 138 Introduction of java

What is the default data type of floating point literal?

A long
B boolean
C double
D char
MCQ 139 Introduction of java

โ€˜Library has a roomโ€™, is an example of which of the following Java Properties?

A Inheritance
B Data Abstraction
C Aggregation
D Polymorphism
MCQ 140 Introduction of java

In Java, what will be the output of 8 % 3?

A 1
B 0
C 2
D 8
MCQ 141 Data types

Java supports how many primitive data types?

A 2
B 4
C 6
D 8
MCQ 142 Repetitive control structures

In Java, which of the following is used to repeat a sequence of statements over and over until some condition occurs?

A Loops
B Branches
C Breaks
D Sets
MCQ 143 Introduction of java

Which of the following is the general expression of conditional operator?

A ?:
B :ย ?< expression2 >
C < expression >?ย : < expression2 >
D All of the given
MCQ 144 Introduction of java

Which symbol is used to add single line comment in Java?

A /
B / *
C //*
D //
MCQ 145 Introduction of java

Which menu and commands are used to compile Java source file in SciTE Text Editor?

A Fileโ†’Compile
B Tools โ†’Compile
C Edit โ†’ Compile
D Tools โ†’ Run
MCQ 146 Introduction of java

Which of the following is mandatory method in Java program?

A private
B public
C main
D protected
MCQ 147 Introduction of java

How many bytes are occupied by int data type in Java?

A 2
B 4
C 6
D 8
MCQ 148 Introduction of java

For which of the following, break statement is used within switch statement?

A To end the switch statement
B To repeat switch statement
C To end the program
D All of the given
MCQ 149 Introduction of java

Which of the following is a valid variable name in java, if variable name includes several words?

A balanceAmount
B birth_date
C BirthDate
D All of the given
MCQ 150 Introduction of java

Which of the following operators do not have left-to-right associativity?

A *=
B &&
C +. -
D *, ?, %
MCQ 151 Introduction of java

Which of the following can't be nested?

A Loop
B Comment
C Both A and B
D None of the given
MCQ 152 Introduction of java

\uddd represents _______________________

A character represented by three octal digits
B character represented by two hexadecimal digits
C character represented by unicode number dddd
D None of the given
MCQ 153 Introduction of java

Which of the following is a format of block?

A { < statements > }
B < statements > { }
C if < > { statement }
D case < constant-1 > { }
MCQ 154 Introduction of java

Which sign is used to enclose multi-line comments in Java?

A /* and */
B / and
C // and \\
D /** and **/
MCQ 155 Introduction of java

Which menu and commands are used to compile Java source file in SciTE text Editor?

A File โ†’ Run
B Tools โ†’ Run
C Options โ†’ Go
D Tools โ†’ Go
MCQ 156 Introduction of java

What should be the extension of Java file?

A .c
B .java
C .class
D .doc
MCQ 157 Introduction of java

Which sign is used to separate the variables while declaring more than one variable in Java program?

A ,
B ;
C :
D #
MCQ 158 Introduction of java

Which of the following takes place when no match is found with any case values of switch statement?

A The default statement is executed
B First statement of case takes place
C Last statement of case takes place
D None of the given
MCQ 159 Introduction of java

In Java, names of __________________ begin with upper case letters.

A class
B variable
C method
D Both B and C
MCQ 160 Introduction of java

In Java, floating point literal by default is of the type _____________

A Real
B double
C int
D long int
MCQ 161 Introduction of java

Which of the following will represent the string value: Many "Congratulations!โ€

A "Many Congratulations!"
B "Many, \"Congratulations !\โ€โ€
C \"Many Congratulations!"\
D None of the given
MCQ 162 Introduction of java

In Java, arithmetic operation, when both operands are of different data types, lower range data type is implicitly converted to higher data type. This type of conversion is known as _______

A Typecasting
B Promotion
C A or B
D None of the given
MCQ 163 Introduction of java

The statement of which loop are executed at least once?

A for
B while
C do... while
D All of the given
MCQ 164 Introduction of java

Which sign is used to add documentation comments in Java program?

A // and \\
B /** and **\
C /** and */
D All of the given
MCQ 165 Introduction of java

Which of the following class is compulsory in Java program?

A Public method main()
B Public display ( )
C Body()
D None of the given
MCQ 166 Introduction of java

Which of the following is Java compiler?

A javac
B jrc
C java
D None of the given
MCQ 167 Introduction of java

Which of the following is an invalid Java variable?

A marks
B %marks
C $marks
D Marks
MCQ 168 Introduction of java

Which of the following is entry-controlled loop?

A for
B do... while
C Both A and B
D None of the given
MCQ 169 Introduction of java

What do the Data type determines ?

A required memory size
B type of values
C range of values and type of operations that can be performed
D All of the given
MCQ 170 Introduction of java

The names of ______________ begin with lower case letters in Java.

A variable
B method
C Both A and B
D class
MCQ 171 Introduction of java

Simple expression in Java can be a ______________

A literal
B variable
C function call
D A or B or C
MCQ 172 Introduction of java

Which of the following operator has right to left associativity?

A ++, - -
B =, +=
C ?:
D All of the given
MCQ 173 Introduction of java

Which statement is used to transfer the control outside switch or loop structure?

A stop
B exit
C break
D end
MCQ 174 Introduction of java

Which of the following is not a comparison operator?

A >
B <
C !=
D %
MCQ 175 Introduction of java

Which method is used to add a linefeed after the end of information?

A System.out
B System.out.print
C System.line
D System.out.println
MCQ 176 Introduction of java

Which of the following extension file gets created when the java source file gets compiled without any error?

A .java
B .exe
C .mac
D .class
MCQ 177 Introduction of java

Which of the following is a valid Java Variable?

A 4total
B _total
C %total
D None of the given
MCQ 178 Introduction of java

Which loop is used when number of iterations are pre-determined?

A for
B while
C do... while
D All of the given
MCQ 179 Introduction of java

In case of short circuiting-as logical operator _________________ results in false when any one of the operands is false, there is no need to evaluate second sub-expression.

A ||
B & &
C ?:
D *=
MCQ 180 Introduction of java

The unicode code sequence \u2122 produces a ________________________ symbol.

A TM
B ยฎ
C ยฉ
D @
MCQ 181 Introduction of java

Which of the following is unicode literal in Java?

A 45
B 0X45
C \ u00E9
D 0b10110
MCQ 182 Introduction of java

Which of the following refers to memory location in Java assignment statement?

A A variable used on the left-hand side of assignment statement.
B Operand of the expression
C A variable used on right-hand side
D All of the given
MCQ 183 Introduction of java

Which of the following is exit controlled loop?

A while
B do... while
C for
D All of the given
MCQ 184 Introduction of java

Which of the following operators when used in an expression results as boolean value?

A Arithmetic
B Logical
C Comparison
D All of the given
MCQ 185 Introduction of java

Which method display only information without adding a line feed at the end of the information?

A System.print
B System.out.println
C System.out.print
D System.println
MCQ 186 Introduction of java

The extension of Java byte code file is _____________________

A .class
B .byte
C .java
D .exe
MCQ 187 Introduction of java

In Java, there are ______ kind of variables.

A 2
B 3
C 4
D 5
MCQ 188 Introduction of java

In which circumstances the for (::) loop will result in infinite loop?

A When break statement is not executed
B When some control statement is not used in for loop
C A or B
D None of the given
MCQ 189 Introduction of java

Function parameters and variables declared in the function are considered as ________ in Java.

A Instance variable
B Local variable
C Class variable
D Global variable
MCQ 190 Introduction of java

A unicode literal consists of ____________ followed by four hexadecimal digits.

A \u
B \ul
C ox
D OX
MCQ 191 Introduction of java

The basic building blocks of expressions are ______

A literals
B variables
C function calls
D All of the given
MCQ 192 Introduction of java

In short circuiting, if first operand is true in ____ there is no need to evaluate second operand.

A &&
B ||
C !
D ?:
MCQ 193 Introduction of java

Which loop first executes the statements of a loop and then evaluates the test expression?

A for
B do... while
C while
D All of the given
MCQ 194 Introduction of java

What is the result of test expression after applying comparison operator to it?

A Numeric
B Boolean
C Both A and B
D None of the given
MCQ 195 Introduction of java

The text written with system.out.print method is enclosed within __________ in Java program.

A โ€œ โ€œ
B โ€˜ โ€˜
C # #
D All of the given
MCQ 196 Introduction of java

Which of the following command is used to execute the Java file after successful compilation?

A javac
B javae
C java
D run
MCQ 197 Introduction of java

Which of the following is not a type of a variable in Java?

A Camelcase variable
B Instance variable
C Integer variable
D Float variable
MCQ 198 Introduction of java

What does x+=y stands for in Java?

A x + y = x
B x+x=y
C x=x+y
D y=x+y
MCQ 199 Introduction of java

In Java, with modulus operator %, if first operand is negative, _____________

A the result is negative
B the result is positive
C mathematical process will not take place
D None of the given
MCQ 200 Introduction of java

Which of the following uses three operands?

A Conditional operator
B Short circuiting
C Relational operator
D Shorthand assignment operator
MCQ 201 Introduction of java

Which of the following has associativity from right to left?

A type_cast
B ++, - -, !
C unary-and +
D All of the given
MCQ 202 Introduction of java

Which of the following is/are an escape characters in Java?

A \n
B \ddd
C \xdd
D All of the given
MCQ 203 Real number literals

What is an international standard for defining real numbers in java ?

A IEEE654
B IEEE555
C IEEE754
D IEEE455
MCQ 204 Variables

Which of the following words is not a reserved word?

A while
B $price
C static
D class
MCQ 205 Use of brake and continue statement

Which statement is used to transfer the control outside switch or loop structure?

A Continue
B Break
C Go
D if ร‚ย 
MCQ 206 Introduction of java

In Java, which statement is used to transfer the control outside switch or loop structure ?

A break
B loop
C continue
D go
MCQ 207 Introduction of java

In Java, which of the following is used to repeat a sequence of statements over and over until some condition occurs ?

A Loops
B Repeats
C Branches
D Breaks
MCQ 208 Introduction of java

Which of the following variable name is not valid in Java?

A _marks
B 4subject
C total_marks
D $age
MCQ 209 Introduction of java

What is it called when ++ operator is used after variable name in Java?

A post increment
B pre increment
C increment pre
D pre decrement
MCQ 210 Introduction of java

Single line comment begins with which sign in Java?

A /*
B /**
C //
D ALL
MCQ 211 Introduction of java

What sign is used for creating API documentation from the code ?

A //
B /*
C */
D /**
MCQ 212 Introduction of java

Java language was developed by whom?

A Sun Microsystem
B Oracle
C Netscape
D Microsoft
MCQ 213 Introduction of java

In Java, which of the following is same as q && = p?

A q = qp
B q=q-p
C q=q+p
D q=q && p
MCQ 214 Introduction of java

In Java, which logical operator results in complemented result?

A NOT
B AND
C OR
D XOR
MCQ 215 Introduction of java

In Java, which of the following is an invalid variable name?

A totalAmount
B birth Date
C $price
D top5students
MCQ 216 Introduction of java

In Java, in switch statement, which of the following statements will be executed, when no match is found?

A break
B default
C continue
D exit
MCQ 217 Introduction of java

In Java, what will be the value of variable next, where next (N%2==0)? (N/2): (3*N+1); and N is 9?

A 4.5
B 9
C 28
D Error
MCQ 218 Introduction of java

In Java, which of the following 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 Switch statement
B For loop
C While loop
D If-statement
MCQ 219 Introduction of java

Which of the following commands is used to compile the Java program?

A run
B execute
C javac
D java
MCQ 220 Introduction of java

Which language is considered as one of the ideal language for distributing executable programs via the World Wide Web?

A CSS
B HTML
C JavaScript
D Java
MCQ 221 Introduction of java

In Java, which of the following determines the required memory size, type of values, range of values and type of operations that can be performed?

A Data Types
B Operators
C Comments
D Literals
MCQ 222 Introduction of java

Which of the following is a valid variable name in Java?

A 4me
B birth date
C date
D %discount
MCQ 223 Introduction of java

In the structure of Java program, what is used as a place holder?

A Text in <> brackets
B Text in { } brackets
C Text in ( ) brackets
D Text in [ ] brackets
MCQ 224 Introduction of java

Which type of Java comment is usually used to have more than one line as comments?

A Single-line comment
B Keyword comment
C Multi-level comment
D Multi-line comment
MCQ 225 Introduction of java

In Java, which of the following syntax is used to declare a variable?

A {type-name};
B {variable-names };
C ;
D ;
MCQ 226 Introduction of java

In the conditional operator of Java, which symbols are used in the expression to delimit three operands?

A ?:
B +$
C #$
D #%
MCQ 227 Introduction of java

In Java, which of the following is a valid example of octal number?

A "037"
B 0x2A
C -59
D \400E9
MCQ 228 Introduction of java

In Java, what are used to choose among two or more possible courses of action?

A Loops
B Variables
C Class
D Branches
MCQ 229 Introduction of java

What is the default data type of floating point literal?

A long
B boolean
C double
D char
MCQ 230 Introduction of java

In Java, what will be the output of 8 % 3?

A 1
B 0
C 2
D 8
MCQ 231 Introduction of java

Java supports how many basic (primitive) data types ?

A 8
B 2
C 4
D 6
MCQ 232 Introduction of java

To compile the java program we have to type what in front of source file name ?

A java filename.java
B javac filename
C javac filename.class
D javac filename.java
MCQ 233 Introduction of java

In Java, which of the following is used to repeat a sequence of statements over and over until some condition occurs ?

A Loops
B Repeats
C Branches
D Breaks
MCQ 234 Introduction of java

In Java, a name used for constant value is known as what ?

A Function
B Operator
C Literal
D Variable
MCQ 235 Introduction of java

If a=12.5 and b=7.2, then after executing a%b, what will be the remainder?

A 1
B 5.3
C 5
D 1.22
MCQ 236 Introduction of java

If the conditional ternary is (N%2==0)?(N/2):(3*N+1); where N=7 then what will be the value of variable next?

A 22
B 7
C 3.5
D 0
MCQ 237 Introduction of java

do โ€ฆ.. while loop is which type of loop ?

A Loop controlled
B Break controlled
C Exit controlled
D Entry controlled
MCQ 238 Introduction of java

To use a labeled loop, which symbol is added before the loop?

A *
B $
C :
D @
MCQ 239 Introduction of java

From the following which methods are used to display results?

A System.out.print()
B System.out.println()
C Both (A) & (B)
D System.out.display()
MCQ 240 Introduction of java

In java, the program is compiled without any error, which command is used to execute it?

A Tools -> Go
B Tools -> Run
C Tools -> Build
D Tools -> Compile
MCQ 241 Introduction of java

From the following which are the examples of reserved words in Java?

A class
B public
C static
D All of these
MCQ 242 Introduction of java

In java, at which level platform โ€“independence is possible due to bytecode interpreter?

A browser
B source
C machine
D binary
MCQ 243 Introduction of java

In java, variable name should begin with which of the following?

A Albhabet
B Underscore
C Dollar
D All of these
MCQ 244 Introduction of java

Arithmetic operators in java, can be applied on which numeric data?

A short
B float
C double
D All of these
MCQ 245 Introduction of java

Java language was developed by whom?

A Sun Microsystem
B Oracle
C Netscape
D Microsoft
MCQ 246 Introduction of java

The alphabet D in JDK stands for which of the following?

A Department
B Development
C Design
D Desktop
MCQ 247 Introduction of java

In Java, which of the following is same as q && = p?

A q = qp
B q=q-p
C q=q+p
D q=q && p
MCQ 248 Introduction of java

In Java, which escape code represents โ€˜carriage returnโ€™?

A \n
B \r
C \t
D \f
MCQ 249 Introduction of java

In Java, in switch statement, which of the following statements will be executed, when no match is found?

A break
B default
C continue
D exit
MCQ 250 Introduction of java

In Java, which of the following determines the required memory size, type of values, range of values and type of operations that can be performed?

A Data Types
B Operators
C Comments
D Literals
MCQ 251 Introduction of java

In the conditional operator of Java, which symbols are used in the expression to delimit three operands?

A ?:
B +$
C #$
D #%
MCQ 252 Introduction of java

In Java, which of the following is a valid example of octal number?

A "037"
B 0x2A
C -59
D \400E9
MCQ 253 Introduction of java

In Java, what are used to choose among two or more possible courses of action?

A Loops
B Variables
C Class
D Branches
MCQ 254 Introduction of java

How many bytes are occupied by int data type in Java?

A 2
B 4
C 6
D 8
MCQ 255 Introduction of java

In Java, arithmetic operation, when both operands are of different data types, lower range data type is implicitly converted to higher data type. This type of conversion is known as _______

A Typecasting
B Promotion
C A or B
D None of the given
MCQ 256 Introduction of java

The unicode code sequence \u2122 produces a ________________________ symbol.

A TM
B ยฎ
C ยฉ
D @
MCQ 257 Introduction of java

In Java, there are ______ kind of variables.

A 2
B 3
C 4
D 5
MCQ 258 Introduction of java

A unicode literal consists of ____________ followed by four hexadecimal digits.

A \u
B \ul
C ox
D OX
MCQ 259 Introduction of java

In short circuiting, if first operand is true in ____ there is no need to evaluate second operand.

A &&
B ||
C !
D ?:
MCQ 260 Introduction of java

Single line comment begins with which sign in Java?

A /*
B /**
C //
D ALL
MCQ 261 Introduction of java

In case of short circuiting-as logical operator _________________ results in false when any one of the operands is false, there is no need to evaluate second sub-expression.

A ||
B & &
C ?:
D *=
MCQ 262 Introduction of java

In Java, a block statement is a group of statements enclosed between which bracket ?

A &lt; &gt;
B ( )
C [ ]
D { }
MCQ 263 Introduction of java

In Java, variable name should begin with which of the following ?

A Underscore (_)
B All of these
C Alphabet
D Dollar sign ($)
MCQ 264 Introduction of java

In Java, what is the default value of Boolean data type ?

A TRUE
B 1
C 0
D FALSE
MCQ 265 Introduction of java

Control structure branches are used to choose among two or more possible courses of action, is called as what ?

A More structure
B Loop structure
C Addition structure
D Selective structure
MCQ 266 Introduction of java

In java, the program is compiled without any error, which command is used to execute it?

A Tools -> Go
B Tools -> Run
C Tools -> Build
D Tools -> Compile
MCQ 267 Introduction of java

From the following which is not logical operator in Java?

A And
B Or
C Not
D Equal
MCQ 268 Introduction of java

In java, at which level platform โ€“independence is possible due to bytecode interpreter?

A browser
B source
C machine
D binary
MCQ 269 Introduction of java

In Java, which escape code represents โ€˜carriage returnโ€™?

A \n
B \r
C \t
D \f
MCQ 270 Introduction of java

For which of the following, break statement is used within switch statement?

A To end the switch statement
B To repeat switch statement
C To end the program
D All of the given
MCQ 271 Introduction of java

In Java, names of __________________ begin with upper case letters.

A class
B variable
C method
D Both B and C
MCQ 272 Introduction of java

In case of short circuiting-as logical operator _________________ results in false when any one of the operands is false, there is no need to evaluate second sub-expression.

A ||
B & &
C ?:
D *=
MCQ 273 Introduction of java

In Java, there are ______ kind of variables.

A 2
B 3
C 4
D 5
MCQ 274 Introduction of java

A unicode literal consists of ____________ followed by four hexadecimal digits.

A \u
B \ul
C ox
D OX
MCQ 275 Introduction of java

In Java, what will be the output of 8 % 3?

A 1
B 0
C 2
D 8
MCQ 276 Introduction of java

If a=12.5 and b=7.2, then after executing a%b, what will be the remainder?

A 1
B 5.3
C 5
D 1.22
MCQ 277 Introduction of java

From the following which methods are used to display results?

A System.out.print()
B System.out.println()
C Both (A) & (B)
D System.out.display()
MCQ 278 Introduction of java

From the following which are the examples of reserved words in Java?

A class
B public
C static
D All of these
MCQ 279 Introduction of java

Arithmetic operators in java, can be applied on which numeric data?

A short
B float
C double
D All of these
MCQ 280 Introduction of java

How many bytes are occupied by int data type in Java?

A 2
B 4
C 6
D 8