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
8. Java source code file.
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.
12. string array
13. A – Z, a – z, _ ,$
14. 1) // -- single line comment
2) ) /* --
*/ multiple line comment
3) /** --
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;
26. Addition operator(+).
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.
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
40.x = 6; y = 6
41.x = 6; z = 5
42.The value assigned is 20
47.The break keyword halts the execution of the current loop and forces control out of the loop.
- The continue is similar to break, except that instead of halting the execution of the loop, it starts the next iteration
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.;
55. A constructor is a special kind of method that determines how an object is
initialized when created
58. Casting is bused to convert the value of one type to another
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
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.
76.A and B
80.A,B and C
85.A,C and D
86.A and D
choice(1,2,3,4 in numbers)