JAVA LAB INTERNAL VIVA SAMPLE QUESTIONS

estrapadesherbetΛογισμικό & κατασκευή λογ/κού

18 Νοε 2013 (πριν από 3 χρόνια και 10 μήνες)

73 εμφανίσεις

JAVA LAB INTERNAL
VIVA
SAMPLE QUESTIONS


1)

What is OOPS?

2)

What is the difference between Procedural and OOPs?

3)

What are encapsulation, inheritance and polymorphism?

4)

What is the difference between assignment and initialization?

5)

What are the class constructor an
d private data types?

6)

What is an object and how do you allocate memory to it?

7)

What is the difference between a constructor and a method?

8)

What are the methods and how are they defined?

9)

What is the use of bin and lib in JDK?

10)

How many ways can an argument be
passed to a subroutine and explain them?

11)

What is casting?

12)

What is the difference between an argument and a parameter?

13)

What are the different types of access modifiers?

14)

What is final, finalize() and finally?

15)

What is the difference between this() and super()
?

16)

What is the difference between superclass and subclass?

17)

What modifiers may be used with top level class?

18)

What are inner classes and anonymous classes?

19)

What is a package?

20)

What is a reflection package?

21)

What is interface and its use?

22)

What is an abstract cla
ss?

23)

What is UNICODE?

24)

What is garbage collection and how to call it explicitly?

25)

What is finalize()?

26)

What are transient and volatile modifiers?

27)

What is method overloading and overriding?

28)

What is the difference between overloading and overriding?

29)

What is mean
t by inheritance and what are its advantages?

30)

What is the difference between an Integer and int?

31)

What is the cloneable interface and how many methods does it contain?

32)

What is the difference between an abstract class and interface?

33)

Can we have an inner clas
s inside a method? What are the variables that can
be accessed?

34)

What is the difference between String and StringBuffer?

35)

What is the difference between Array and Vector?

36)

What is the difference between exception and error?

37)

Are there any global variables in J
ava, which can be accesses by other part of
your program?

38)

What are wrapper classes?

39)

What is the frontend in Java? Also what is the backend?

40)

When des static binding occur?

41)

What are virtual methods of C++ in Java?

42)

What are the different types of exceptions?

43)

What data structure is the storage space treated as in Java?

44)

What are the access specifiers and access modifiers?

45)

Name some tools provided by JDK.

46)

What is compilation?

47)

Name the primitive data types of Java.

48)

How does Java handle integer overflow and underfl
ow?

49)

What is Vector class?

50)

What modifiers may be used with an inner class that is a member of outer
class?

51)

What is an Iterator interface?

52)

What is the difference between >> and >>> operators?

53)

How

many bits are used to represent UNICODE, ASCII, UTF
-
16 and UTF
-
8
characters?

54)

Is sizeof a keyword?

55)

What are wrapped classes?

56)

Does garbage collection g
uarantee that a program will no
t run out of memory?

57)

Can an object’s finalize() be invoked while it is reachable?

58)

What is a native method?

59)

Can a for statement loop indefi
nitely?

60)

What are order of precedence and associativity and how are they used?

61)

To what value is a
variable

of the String type automatically initialized?

62)

What is the catch or declare rule for method declarations?

63)

Can an anonymous
class

be declared as impleme
nting an interface and
extending a class?

64)

What is the range of a short type?

65)

What is the range of char type?

66)

What is the purpose of finalization?

67)

What is the difference between Boolean & operator and && operator?

68)

What is the purpose of Runtime class?

69)

How m
any times may an object’s finalize() be invoked by the garbage
collector?

70)

What is the purpose of finally clause of a try
-
catch
-
finally statement?

71)

What is the argument type of a program’s main() method?

72)

Which Java operator is right associative?

73)

What is a Lo
cale class?

74)

Can a double value be cast to a byte?

75)

What is the difference between break statement and continue statement?

76)

What must a class do to implement an interface?

77)

How are commas used in the initialization and
iteration

parts of a for
statement?

78)

What
is an abstract method?

79)

How are Java source
code

file named?

80)

Can

a

byte object be cast to a double value?

81)

What is the difference between a static and nonstatic inner class?

82)

What is the difference between String and StringBuffer classes?

83)

If a variable is de
clared as private, where may be the variable accessed?

84)

What is the % operator?

85)

When can an object reference be cast to an interface reference?

86)

Which class is extended by all other classes?

87)

Can an object be garbage collected while it is still reachable?

88)

Is
a ternary operator written x:y?z or x?y:z ?

89)

What is the difference between Font and FontMetrics classes?

90)

How is rounding performed under integer division?

91)

What classes of exceptions may be caught by a catch clause?

92)

If a class is declared without any access

modifier, where maybe the class be
accessible?

93)

Does a class inherit the
constructors

of its superclass?

94)

What is the purpose of System class?

95)

Is &&= a valid Java operator?

96)

Name the 8 Java primitive types.

97)

Which

class should you use to obtain design
informa
tion

about an object?

98)

Is “abc” a primitive value?

99)

What restrictions are placed on the values of each case of a switch statement?

100)

What modifiers may be used with an interface declaration?

101)

Is a class subclass of itself?

102)

What is the difference between a while

statement and do statement?

103)

What modifiers can be used with local inner class?

104)

What is the difference between static and nonstatic variables?

105)

Can an exception be rethrown?

106)

Which Math
method

is used to calculate the absolute value of a number?

107)

How does mul
ti threading take place on a computer with single CPU?

108)

When does compiler supply a default constructor for a class?

109)

When is the finally clause of a try
-
catch
-
finally statement executed?

110)

If a method is declared as protected, where may be the method accessed
?

111)

Which non
-
Unicode letter characters maybe used as the first character of an
identifier?

112)

What restrictions are placed on method overloading?

113)

What is the return type of a programs main() method?

114)

What class of exceptions are generated by the Java
runtime

sy
stem?

115)

What is the difference between a field variable and a local variable?

116)

Under what conditions is an objects finalize method invoked by the garbage
collector
?

117)

How are this() and super used with constructors?

118)

What is the relationship between a methods th
rows clause and the exceptions
that can be thrown during the method execution?

119)

How is it possible for 2 string objects with identical values not be equal under
== operator?

120)

Why are the methods of the Math class static?

121)

What are the legal operands of the in
stanceof operator?

122)

If an object is garbage collected, can it become reachable again?

123)

What is the Set interface?

124)

What classes of exceptions may be thrown by a throw statement?

125)

What are E and PI?

126)

Are true and false keywords?

127)

What is a void return type?

128)

Wha
t
happens when you add

a

double value to a string?

129)

What is a platform’ default character encoding?

130)

Which package is always imported by default?

131)

What interface must an object implement before it can
written to a stream as
an

object?

132)

What is the purpose of gar
bage collection?

133)

What is compilation unit?

134)

What restrictions are placed on method overriding?

135)

What happens if an exception is not caught?

136)

Which arithmetic
operators

can result in the throwing of an
ArithmeticException?

137)

Can an abstract class be final?

138)

What
is the ResourceBundle class?

139)

What happens if a try
-
catch
-
finally statement does not have a catch clause to
handle

an exception that is thrown within the body of a try statement?

140)

What is a numeric promotion?

141)

What is the difference between a
public

and nonpu
blic class?

142)

To what value is a variable of the Boolean type automatically initialized?

143)

Can try statement be nested?

144)

What is the difference between prefix and postfix forms of the ++ operator?

145)

What is the purpose of a statement block?

146)

What is the Java packa
ge and how is it used?

147)

What modifiers maybe used with a toplevel class?

148)

What are the Object and Class classes used for?

149)

How does a try statement determine
which

catch clause should be used to
handle an exception?

150)

Can an unreachable object become reachable
again?

151)

When is an object subject to garbage
collection
?

152)

What is the difference between an if statement and switch statement?

153)

What happens when you add a double value to a string?

154)

What is the List interface?

155)

What is Unico
d
e?

156)

What are blocks?

157)

What are types
of Java applications?

158)

What is the method that gets invoked first in a stand alone application?

159)

What is throwing an exception?

160)

What are the packages in JDK?

161)

What is a thread?

162)

Is null a keyword?

163)

How are Observer and
Observable

used?

164)

What is the Collections A
PI?

165)

Which characters may be used as the second characters of an
identifier

but not
as the first character of an identifier?