Question
1. (4 points) Consider the following Java code. public class MyClass { public static void doSomething(char c, float[] f) { ??? } public static void
1. (4 points) Consider the following Java code.
public class MyClass { public static void doSomething(char c, float[] f) {
??? }
public static void main(String[] args) { char letter = a; float[] arr = {1.2, 3.4, 5.6, 7.8}; doSomething(letter, arr); System.out.println(letter); System.out.println(f[0]);
} }
Which of the following is definitely true? Fill in one or more choices.
The value printed in the penultimate statement of main is a. The value printed in the penultimate statement of main is not a. The value printed in the last statement of main is 1.2. The value printed in the last statement of main is not 1.2.
2. (4 points) Is the following statement true or false? Justify your answer. All Java interfaces are abstract classes, but not all abstract classes are Java interfaces.
3. (12 points) Given the following cines definition fragments and class instantiations complete the table below. Anstitute that the inthuc s u lere do not appear in my atter classes E... The Fiestaurant class du wul cellule s toString med ! close Building { publla Point Lacation .. close Reeluurant uxloe Building { public int 1.3.4.COL ... ] Claas Lab extends Building ( pablic String toString() ... } clase Danor extende Restaurant [ pablic boolean equals(Object other) ...) Lab 1 = new Lab : Restaurant : - new Daner(); Building - 1; Object O=r: iuvukud will Il est black linicale wou will laupun bellwd in eacta cului the object ob in each row. Choom fonly one) from the following exampiler TOT runtime error (i.., an exception is thron X, where X is the class Erol wluch the method is called TL zal uw we Leeuw Cor you, as a pe obt obt.getLacation() 05.get&catCount) ab.tostring0 Building mampir Or l ab ot.equals(obj) Object 1. (1 pointe) What is the running tice of the following loop nie? for(int 1 = 0; 1 c; j--) Byelem.out.println("bello vorla'); Ful: erucily one chance. lugacillaric lineet Nlog quralic cubic
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started