Answers

1.A

2.A

3.A

4.A

5. A class and the main( ) method declarations.

6. Two parts in executing a Java program are:

Java Compiler and Java Interpreter.

The Java Compiler is used for compilation and the Java Interpreter is used for execution of the application.

7. Encapsulation, Inheritance and Polymorphism are the three OOPs

Principles.

8. Java source code file.

9.b

10. : Identifiers are used for class names, method names and variable names. An identifier may be any descriptive sequence of upper case & lower case letters,numbers or underscore or dollar sign and must not begin with numbers.

11. void

12. string array

13. A – Z, a – z, _ ,$

14. 1) // -- single line comment

2) ) /* --

*/ multiple line comment

3) /** --

*/ documentation

15. Constructor will be automatically invoked when an object is created. Whereas method has to be call explicitly.

16.Bin contains all tools such as javac, applet viewer, awt tool etc., whereas Lib

contains all packages and variables.

17. Variables are locations in memory that can hold values. Before assigning any value to a variable, it must be declared

18. Java has three kinds of variables namely, the instance variable, the local variable and the class variable.

19. Variables can be declared anywhere in the method definition and can be initialized during their declaration.They are commonly declared before usage at the beginning of the definition

20. Variable types can be any data type that java supports, which includes the eight primitive data types, the name of a class or interface and an array.

21. Values are assigned to variables using the assignment operator =.

22. An array is an object that stores a list of items.

23. int arr[];

24.A

25.A

26. Addition operator(+).

27.A

28.D

29.B

30. The array subscript expression can be used to change the values of the elements of the array.

31. If a variable is declared as final variable, then you can not change its value. It becomes constant

32. Static variables are shared by all instances of a class.

33.A

34.A

35.A

36. OR(|), AND(&), XOR(^) AND NOT(~).

37. % operator is the modulo operator or reminder operator. It returns the reminder of dividing the first operand by second operand

38.= operator.

39.D

40.x = 6; y = 6

41.x = 6; z = 5

42.The value assigned is 20

43.B

44.A

45.B

46.A

47.The break keyword halts the execution of the current loop and forces control out of the loop.

  1. The continue is similar to break, except that instead of halting the execution of the loop, it starts the next iteration

48.A

49.A

50.A

51. When an object is no longer referred to by any variable, Java automatically

52. Methods are functions that operate on instances of classes in which they are defined.Objects can communicate with each other using methods and can call methods in other classes.

Method definition has four parts. They are name of the method, type of object or primitive type the method returns, a list of parameters and the body of the method.

53. Calling methods are similar to calling or referring to an instance variable. These methods are accessed using dot notation.

54. To import a class, the import keyword should be used as shown.;

import classname:

55. A constructor is a special kind of method that determines how an object is

initialized when created

56.new

57.finalize()

58. Casting is bused to convert the value of one type to another

59. a,b,c.

60. a,b,d.

61.B

62.C

63.C

64.B

65. Using interfaces.

66. Serializable, Cloneble & Remote

67. Exceptions that are thrown by java runtime systems can be handled by Try and catch blocks. With throw exception we can handle the exceptions thrown by the program itself. If a method is capable of causing an exception that it does not

handle, it must specify this behavior so the callers of the method can guard

against that exception.

68. : 1.process-based

2.Thread-based

69. 1.by implementing Runnable

2.by extending Thread

70. A super class is a class that is inherited whereas subclass is a class that does the inheriting.

71.C

72.C

73.A

74.C

75.D

76.A and B

77.A

78.C

79.E

80.A,B and C

81.C

82.B

83.C

84.A

85.A,C and D

86.A and D

87.D

88.A

89.D

90.A

choice(1,2,3,4 in numbers)

91.4

92.1

93.2

94.2

95.1

96.2

97.4

98.1

99.2

100.1

101.3

102.1

103.3

104.2

105.1,2,3

106.3

107.3

108.1

109.2

110.1,2,3,4

111.3

112.1,2,3

113.2

114.4

115.2

116.1

117.1

118.4

119.3

120.2

121.2

122.2

123.1,5