I need help with these 7 questions please. 1. Java interfaces a. can contain fin
ID: 3731485 • Letter: I
Question
I need help with these 7 questions please.
1. Java interfaces a. can contain final variables that are initialized with a value b. can contain multiple abstract methods c. can serve as reference data types d. All the above. e. a and b f. a and c 2. If the class Turkey implements the Edible interface, then the relationship between Turkey and Edible is a. has-a b. aggregation C. IS-a d. a and b e. None of the above 3· Class members with this modifier can potentially be accessed outside of the package a. protected b. private c. public d. default e. All the above f. a and c g. a, c,d 4. In the following problem, the class Apple inherits from the class Fruit. Which of the following is true? public Apple( String name ) super ) //other code for the Apple constructor goes here a. b. c. d. e. The italicized line calls one of the Fruit constructors. The italicized line could have been omitted The above Apple constructor would be explicitly called by any subclasses of Apple when needed All the above. a and bExplanation / Answer
1.d)
Java interfaces can contain final variables ,can contain any no of abstract methods and can be used as reference data types.
2.c)
The relationship between class turkey and edible interface is IS-A as turkey is edible (eatable)
3.f)
The protected and public access specifiers have visibility outside of package also
4.d)
The super() can be used to call parent class constructor ,it could have been omitted as well it is not mandatory to write super(),the apple constructor can be explicitly called by any subclass.
5.e)
In java multiple inheritance is possible only by implementing interfaces,we can implement and extend at same time in java.
6.c)
The only thing we can infer from here is Rectangle is concrete as it is not abstract.
7.c)
The integer class to string gets executed as it overrides object class method.