1.

Consider the following code and answer the questions that follow: class academic { int x, y; void access() {int a, b; academic student = new academic(); System.out.println(“Object created”); } } (i) What is the object name of class academic ? (ii) Name the class variable used in the program. (iii) Write the local variable used in the program. (iv) Give the type of function used and its name.

Answer»

(i) The name of the object of class academic is student. 

(ii) The class variables used; in the program are x and y. 

(iii) The local variables used in the program are a and b.

(iv) The function is of impure type and its name is access ().



Discussion

No Comment Found

Related InterviewSolutions