Java Programming Questions & Answers: part4



Software Programming : Java Programming QUESTIONS AND ANSWERS :: part4 : 6 to 10

Following Software Programming language Entrance Multiple choice objective type questions and answers will help you in Software Programming 2024 examinations :

6.For what values respectively of the variables gender and age would the Java expression gender == 1 && age >= 65 become true?

gender = 1, age = 60
gender = 1, age = 50
gender = 1, age = 65
gender = 0, age = 70
gender = 0, age = 55.

7.Consider the following data types in Java : I. Int II. Boolean III. Double IV. String V. Array. Which of them are simple data types?

Both (I) and (II) above
(I), (II), (III) and (IV) above
(I), (II) and (III) above
(II) and (III) above
All (I), (II), (III), (IV) and (V) above.

8.Consider the following statements about Java packages: I. Packages don’t provide a mechanism to partition all class names into more manageable chunks. II. Packages provide a visibility control mechanism. III. One of the important properties of a package is that all classes defined inside a package is accessible by code outside that package. IV. The .class files for classes declared to be part of a package can be stored in multiple directories. Which of them is correct?

Only (I) above
Only (II) above
Only (III) above
Only (IV) above
All (I), (II), (III) and (IV) above are wrong.

9.Which statement is true regarding an object?

An object is what classes instantiated are from
An object is an instance of a class
An object is a variable
An object is a reference to an attribute
An object is not an instance of a class.

10.Consider the following statements: I. A class can be declared as both abstract and final. II. A class declared as final can be extended by defining a sub-class. III. Resolving calls to methods dynamically at run-time is called late binding. IV. The class Object defined by Java need not be a super class of all other classes. Identify the correct statement from the following:

Both (I) and (II) above
Both (III) and (IV) above
Both (I) and (III) above
Both (II) and (IV) above
Only (III) above.

More Java Programming QUESTIONS AND ANSWERS available in next pages

    Health is the greatest gift, contentment is the greatest wealth -Buddha
The only place where success comes before work is in the dictionary.- Vidal Sassoon