Q1 JAVA does not support

A. pointers

B. global variables

C. multiple inheritance

D. all of the above

Q2 An expression

A. usually evaluates to a numerical

B. may be a part of a statement

C. always occurs outside of a function

D. both a&b

Q3 in JAVA, a function contained with in a class is called___

A. a member function

B. an operator

C. a class function

D. a method

Q4 main() returns a value of type

A. real

B. char

C. int

D. null

Q5 The dot operator connects the following 2 entities(reading from left to right)

A. a class member & class object

B. a class object &a class

C. a class & a member of that class

D. a class object & a member of that class

Q6 classes are useful because they

A. permit data to be hidden from other classes

B. bring together all aspects of an entity in one plan

C. can closely model objects in the real word

D. all of the above

Q7 which of the following expressions result in a positive value in x

A. int x=-1;x>>>5;

B. int x=-1;x=x>>>32

C. byte x=-1;x=x>>>5;

D. int x=-1;x>>5;

Q8 what tags are mandatory when creating HTML to display an applet

A. name,hieght,width

B. code,name

C. codebase,hieght,width

D. code,hieght,width

Q9 Java development kit include

A. appletviewer

B. java

C. javap

D. all of the above

Q10 Java standard library includes hundreds of classes and methods grouped into __ functional packages

A. 6

B. 7

C. 9

D. 10

Q11 class members are _____ by default

A. private

B. protected

C. public

D. none of the above

Q12 Java uses____ to destroy a objects created by constructor

A. destructor()

B. destroyer()

C. finalize()

D. none of the above

Q13 Java contains the data types

A. struct

B. union

C. enum

D. none of the above

Q14 Java adds new operator such as instance of and ___

A. >>

B. <<

C. >>>

D. <<<

Q15 Java have a preprocessor

A. limited

B. one

C. two

D. does not have any

Q16 Java communicates with web page through special tag called

A.

B.

C.

D.

Q17 Java includes ___ type of tokens

A. 2

B. 7

C. 8

D. 5

Q18 Java specifies __ major type of literals

A. 4

B. 5

C. 7

D. 6

Q19 new operator is used

A. to dynamically allocate storage

B. to statically allocate storage

C. to allocate storage for new variable

D. none of the above is correct

Q20 which of the following can legitimately be passed to a function

A. a constant

B. a variable

C. a structure

D. a header file

Q21 method overloading

A. are a group of function with same name

B. all have the same number and type of arguments

C. make life simpler for programmer

D. may fail unexpectedly due to stress

Q22 in a class specifier data or function designated private are accessible

A. to any function in the program

B. only if you know the password

C. to member functions of that class

D. only to public members of the class

Q23 In stack data item placed on the stack first is

A. not given an index number

B. given the index number 0

C. the first data item to be removed

D. the last data item to be removed

Q24 A floating point constant comprise

A. a whole number

B. a decimal point

C. a fractional part

D. all of the above

Q25 variable name should not be start with

A. digit

B. uppercase letter

C. lowercase letter

D. all of the above

Q26 When Java does the type conversion it is said to be

A. automatic type conversion

B. artificial type conversion

C. virtual type conversion

D. all of the above

Q27 what will be the value if n=1 of x and y after the following is a segment of a program:x=1;y=1;if(n>0) x=x+1;y=Y-1;

A. 2,0

B. 1,-1

C. 2,1

D. none of the above

Q28 In Java this keyword can be used anywhere

A. in the object

B. in dot notation

C. as an argument to a method

D. all of the above

Q29 method definitions have basic parts

A. the name of method

B. the type of object or primitive type returned by t

C. the body of the method

D. all of the above

Q30 in Java main() method takes how many no. of parameters

A. 1

B. 2

C. 3

D. 4

Q31 constructor method have

A. the same name as the class

B. not any return type

C. both option 1&2

D. none of the above

Q32 what is the output of the following program segment for(i=1,j=0;i<10;i++) j+=i;system.out.println("i="+i);

A. 10

B. 20

C. 55

D. there is error in program

Q33 the ? Can be used to replace

A. returns the value

B. if then else

C. wild characters

D. no meaning

Q34 which one is false incase of vectors in Java

A. can hold objects of any type

B. objects of any number

C. objects have to be homogenous

D. all of the above

Q35 by using protected one can create class members that are private to their class but

A. that can't be inherited and accessed by a derived class

B. that can still be inherited and accessed by a derived class

C. that can be public

D. none of the above

Q36 the members of a class can be made private

A. declaring them private

B. by default they are private

C. by declaring them in the beginning of the program immediately after main()

D. they are always public

Q37 which of the following are valid methods in java

A. list.size()

B. list.addelement(item)

C. list.copyInto(array)

D. all of the above

Q38 vectors can handle primitive data types

A. int.char

B. float

C. long,double

D. none of the above

Q39 Packages are java's way of

A. grouping a variety of classes and interfaces together

B. grouping a variety of classes or interfaces together

C. both of the above

D. none of the above

Q40 there are ___ ways of accessing the classes stored in a package

A. only one

B. two

C. three

D. four

Q41 in java if you want to import all the classes in a package you will use

A. import java.awr.*

B. import java.awt.all

C. import java.awt.every

D. none of the above

Q42 In java which is valid

A. like classes, interfaces are declared in source files

B. like classes,interfaces are also compiled into .class files using the java compiler

C. both 1& 2

D. none of the above

Q43 an end of line is indicated by the following

A. a newline character('\n')

B. a carriage return character('\r')

C. a carriage return followed by a newline

D. all of the above are correct

Q44 there are following phases in lifecycle of threads in java

A. three

B. four

C. five

D. two

Q45 a class hierarchy

A. shows the same relationships as an organisation chart

B. describes "has a" relationships

C. describes "is akind of"relationships

D. shows the samerelationships as a family tree

Q46 an array element is accessed using

A. a firstin first out approach

B. the dot operator

C. a member name

D. an index number

Q47 public,private,protected are

A. access keywords

B. structure keywords

C. exception keyword

D. not the keywords

Q48 exception keywords

A. throw

B. try

C. catch

D. all of the above

Q49 which one is bitwise operator

A. &&

B. ||

C. &

D. <<>

Q50 which one is comment indicator

A. ?

B. \\

C. //

D. ||

Q51 Which statement is true

A. java uses stdio.h header file

B. java uses string.h header files

C. java uses iostream.h header file

D. no header files are used in java

Q52 a static automatic variable is used to

A. make a variable visible to several function

B. make a variable visible to several function

C. converse memory when a function is not executing

D. retain a value a function is not executing.

Q53 In java the class cannot be subclassed is called

A. final class

B. finale class

C. ultimate class

D. no subclass

Q54 two dimentional can be defined as

A. array[4,6]

B. array[1..4,1..6]

C. array[4][6]

D. array(4,6)

Q55 mathematical functions are supported by java in

A. math class

B. arithmatic class

C. string class

D. maths class

Q56 loop operation are performed by

A. if-then-else

B. for statement

C. while statement

D. both 2 &3

Q57 in java to get the control out of loop we use

A. break

B. continue

C. both 1 &2

D. goto

Q58 java is said to be platform independent because

A. it can be executed on dos

B. it can be executed on unix

C. it can be executed on windows

D. all of the above

Q59 dynamic memory can be allocated by the following declaration

A. new

B. volatile

C. static

D. memory

Q60 a method that is called automatically when an object is created is known as

A. instantiation

B. function prototyping

C. constructor

D. structure

Q61 a method that automatically when an object is destroyed

A. function prototyping

B. constructor

C. destructor

D. finalize

Q62 special symbol used by java to document java packages and methods

A. doctags

B. documenttags

C. packagetags

D. docpacktags

Q63 which command is used to genrate API-style HTML documentation automatically

A. doctag

B. javadoc

C. javah

D. javap

Q64 a command that disassembles java.class files

A. javac

B. javav

C. javap

D. javad

Q65 the java debugger is

A. javaerror

B. javad

C. jab

D. jdb

Q66 JDK stands for

A. java debug kit

B. java developer kit

C. java database kit

D. java documentation kit

Q67 In java short is data type of length

A. 8 bits

B. 16 bits

C. 32 bits

D. 4 bits

Q68 API stands for

A. automatic programming interface

B. application programming interface

C. application programming imbedded

D. application pragram interaction

Q69 class error{ public static void main(string args[]){ system.out.println("hello java!")}

A. the output is hello java!

B. the output is error

C. the output is in two lines

D. the output is hello java java

Q70 which java class supports many methods that enable us to draw many types of shapes

A. drawing

B. graphs

C. graphics

D. drawpolygon

Q71 which operator is used to bitwise complement

A. -

B. +

C. --

D. <<

Q72 in java right shift operator is

A. >>

B. <<

C. <>

D. >>+

Q73 In java strings can be concatenated by using

A. +

B. *

C. ++

D. ||

Q74 Java supports

A. multithreading

B. automatic garbage collection

C. multidimentional array

D. Both 1 & 2

Q75 Java compose class libraries for applet and networking programming

A. java.awt

B. java.applet

C. java.net

D. all of the above

Q76 a command for running the java compiler

A. javarun

B. javado

C. javaexecute

D. javac

Q77 a base class is inherited by

A. derived class

B. inline function

C. constructor

D. none of the above

MCQ Questions, ihkcl.in
MCQ Questions, ihkcl.in
MCQ Questions, ihkcl.in
MCQ Questions, ihkcl.in
MCQ Questions, ihkcl.in
MCQ Questions, ihkcl.in