Question: The following program contains 7 mistakes! What are they? What output is produced for each of the following calls? a. IfElseMystery1(3, 20); b. IfElseMystery1(4, 5);
The following program contains 7 mistakes! What are they?
![1 1 public class Oops4 { 2. public static void main (String[] args) { 3. int a = 7, b = 42; %3D 4 minimum (a, b); if {smaller = a} { System.out.println (](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1606/8/0/4/0785fc5e26edd17d1606804078120.jpg)
What output is produced for each of the following calls?
a. IfElseMystery1(3, 20);
b. IfElseMystery1(4, 5);
c. IfElseMystery1(5, 5);
d. IfElseMystery1(6, 10);
1 1 public class Oops4 { 2. public static void main (String[] args) { 3. int a = 7, b = 42; %3D 4 minimum (a, b); if {smaller = a} { System.out.println ("a is the smallest!"); 8 10 public static void minimum (int a, int b) { 11 if (a < b) { 12 int smaller = a; 13 } else (a => b) { 14 int smaller = b; 15 16 return int smaller; 17 18
Step by Step Solution
3.37 Rating (166 Votes )
There are 3 Steps involved in it
Mistakes in Oops4 program 1 line 5 if statement should use parentheses not ... View full answer
Get step-by-step solutions from verified subject matter experts
