1 answer

Q15 What is the type of each of the variables? 12 Points Consider the following class:...

Question:

Q15 What is the type of each of the variables? 12 Points Consider the following class: public class Overloaded { public int gQ15.3 2 Points Overloaded o = new Overloaded(); variable = 0.getValue(3. 14); Enter your answer here Q15.4 2 Points Overloade

Q15 What is the type of each of the variables? 12 Points Consider the following class: public class Overloaded { public int getValue(int i, long 1) { return 42; } public long getValue(int i) { return 21; } public String getValue(double d) { return "Hello method!"; } public char getValue (double d, int i) { return 'c'; سه مه Q15.1 2 Points Overloaded o = new Overloaded(); variable = 0.getValue(3); Enter your answer here Q15.2 2 Points Overloaded o = new Overloaded(); variable = o.getValue(3, 4); Enter your answer here
Q15.3 2 Points Overloaded o = new Overloaded(); variable = 0.getValue(3. 14); Enter your answer here Q15.4 2 Points Overloaded o = new Overloaded(); variable = 0.getValue(1.0, 3); Enter your answer here Q15.5 2 Points Overloaded o = new Overloaded(); variable = 0.getValue(1.0) + 3; Enter your answer here Q15.6 2 Points Overloaded o = new Overloaded(); variable = 0.getValue(3, 4) + 0.getValue(1.0, 3); Enter your answer here

Answers

public class Main {   public int getValue (int i, long l)   {     return 42;   }   public long getValue (int i)   {     return 21;   }   public String getValue (double d)   {     return "Hello method";   }   public char getValue (double d, int i)   {     return 'c';   }   public static void main (String[]args)   {     Main o = new Main ();     long variable = o.getValue(3);   } } 

Question 15.1 - o.getvalue(3), this will return an LONG value as the return type of the function is LONG

{ 1 public class Main 2 - { 3 public int getValue (int i, long 1) 4. { 5 return 42; 6 } 7 public long getValue (int i) 8 9 re

Question 15.2 - o.getvalue(3,4), this will return an INT value as the return type of the function is INT

3 4- 5 public int getValue (int i, long 1) { return 42; } { 7 public long getValue (int i) 8 9 return 21; 10 } 11 public Stri

Question 15.3 - o.getvalue(3,14), this will return an STRING value as the return type of the function is STRING

{ 1 public class Main 2-{ 3 public int getValue (int i, long 1) 4. 5 return 42; 6 } 7 public long getValue (int i) 8 { 9 retu

Question 15.4 - o.getvalue(1.0, 3), this will return an CHAR value as the return type of the function is CHAR

1 public class Main 2-{ public int getValue (int i, long 1) { return 42; VO V AWNP } public long getValue (int i) { } return

Question 15.5 - o.getvalue(1.0) + 3, this will return an STRING value as the return type of the function is STRING, the value comes to be double after adding.

{ } { 1 public class Main 2- 3 public int getValue (int i, long 1) 4 5 return 42; 6 7 public long getValue (int i) 8 9 return

Question 15.6 - o.getvalue(3,4) + o.getvalue(1.0, 3), this will return an CHAR value as the return type of the function is CHAR, but this will result in lossy conversion

{ { } { 1 public class Main 2-{ 3 public int getValue (int i, long 1) 4- 5 return 42; 6 } 7 public long getValue (int i) 8 9

Thanks

.

Similar Solved Questions

1 answer
The electrical breakdown of an insulator occurs when an electric field becomes large enough to ionize...
The electrical breakdown of an insulator occurs when an electric field becomes large enough to ionize the insulator, allowing electrical current to flow; lightning is an example of the electrical breakdown of air. The electrical breakdown of air occurs when the electric field reaches about 3×1...
1 answer
SECTION B (30 Marks) Answer ALL questions. QUESTION 1 The following information relates to Rocko Bhd....
SECTION B (30 Marks) Answer ALL questions. QUESTION 1 The following information relates to Rocko Bhd. for the year ended 31 Dec 2020 was extracted from the company's records : Sales Depreciation - Office Equipment Utilities Factory Rental Prime Cost Direct Materials purchases Direct Materials, 1...
1 answer
At December 31, 2018, Hull-Meyers Corp. had the following investments that were purchased during 2018, its...
At December 31, 2018, Hull-Meyers Corp. had the following investments that were purchased during 2018, its first year of operations: Cost Fair Value $ 985,000 $ 997,500 190,000 185,400 $1,175,000 $1,182,900 Trading Securities: Security A Security B Totals Securities Available-for-Sale: Security C Se...
1 answer
The differential equation - 3xy? – 2xy + ( - 3x²y - 1x2 +5)- Has solutions...
The differential equation - 3xy? – 2xy + ( - 3x²y - 1x2 +5)- Has solutions of form F(x, y) = c where Preview F(x, y) = 1 Get help: Video...
1 answer
The Windshield Doctors repair chips in car windshields. The company incurred the following operating costs for...
The Windshield Doctors repair chips in car windshields. The company incurred the following operating costs for the month of March 2018: (Click the icon to view the operating costs.) The Windshield Doctors earned $23,000 in service revenues for the month of March by repairing 500 windshields. All cos...
1 answer
A bag containing 3 red marbles, 2 green ones, 8 white ones, and 1 purple one
a bag containing 3 red marbles, 2 green ones, 8 white ones, and 1 purple one. She grabs 3 of them. Find the probability that she has at least 1 green one....
1 answer
A resistor R is connected across a 120 V supply. A voltmeter of 10,000 ohms resistance...
A resistor R is connected across a 120 V supply. A voltmeter of 10,000 ohms resistance is connected between the center of the resistor and one side of the supply and reads 40 V. What is the value of the resistance R?...
1 answer
Please answer all of the following questions. no work needs to be shown. 5) Place the...
please answer all of the following questions. no work needs to be shown. 5) Place the following in order of decreasing IE1 Cs Mg Ar A) Cs > Mg > Ar B) Ar > Mg > Cs C) Mg > Ar> Cs D) Mg > Cs> Ar E) Cs> Ar > Mg...
1 answer
The demand and supply schedules for pop in Vancouver 5. (3)In order to allow affordable access...
the demand and supply schedules for pop in Vancouver 5. (3)In order to allow affordable access to all provincial narks, the government tries to market prices. This could be seen as an example of a price ceiling. Discuss the en price, availability, fairness, winners and losers using a suitable ...
1 answer
In a period of 7.00 s, 5.00 x 1023 nitrogen molecules strike a wall of area...
In a period of 7.00 s, 5.00 x 1023 nitrogen molecules strike a wall of area 5.60 cm2. Assume the molecules move with a speed of 380 m/s and strike the wall head-on in elastic collisions. What is the pressure exerted on the wall? Note: The -26 mass of one Nz molecule is 4.65 x 10 kg. kPa...
1 answer
What is the molecular formula of the product wheb the following compound is transformed through hydrogenation...
what is the molecular formula of the product wheb the following compound is transformed through hydrogenation reastion? do you automatically add 2 H? i counted 12 H....
1 answer
38. Calculate the number of mL of 1.00 M sulfuric acid solution necessary to completely react...
38. Calculate the number of mL of 1.00 M sulfuric acid solution necessary to completely react with 40.0 mL of 0.250 M barium chloride solution? A) 8.25 mL B) 5.25 mL C) 10.0 mL D) 20.4 mL E) 40.8 mL...
1 answer
ACTIVITY 1 Learning Skeletal Muscle Microstructure Materials for This Activity Compound light microscope Prepared slide of...
ACTIVITY 1 Learning Skeletal Muscle Microstructure Materials for This Activity Compound light microscope Prepared slide of skeletal muscle (teased) Model of muscle cell showing parts of a myofibril View a slide of skeletal muscle, and carefully focus and adjust the light so that you can see the stri...
1 answer
Question: A standing wave is established in a string and can be described by the equation:...
Question: A standing wave is established in a string and can be described by the equation: y(2, t) = 4.18 sin(14.4x) cos(980t) cm. Where z is in m and t is in s. Part 1) What is the position of the first anti-node? m Part 2) What is the maximum speed of a piece of string at x = 0.309 m? Umax = m/s P...
1 answer
Find T1 and T2. If the tension each rope can withstand is 800N, will they survive?...
Find T1 and T2. If the tension each rope can withstand is 800N, will they survive? Mi = 175 kg M2 = 154 kg Ti I wish I paid attention in physics T2 + M board = 15.0 kg 2.00 m 3.00 m 8.00 m...
1 answer
Required information [The following information applies to the questions displayed below.] Wanting to finalize a sale...
Required information [The following information applies to the questions displayed below.] Wanting to finalize a sale before year-end, on December 29, WR Outfitters sold to Bob a warehouse and the land for $219,000. The appraised fair market value of the warehouse was $127,500, and the appraised val...