Compare the following lines of code: 1. What makes these different? (a) If x = 3, what will the first print out? (b) If x = 3, what will the second print out? (c)If x = 1, what will the first print out? (d) If x = 1, what will the second print out?

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Modularization Techniques
Section: Chapter Questions
Problem 13RQ
icon
Related questions
Question

For Java

Compare the following lines of code:

1. What makes these different?

(a) If x = 3, what will the first print out?

(b) If x = 3, what will the second print out?

(c)If x = 1, what will the first print out?

(d) If x = 1, what will the second print out?

//Declare x here
if (x == 3)
System.out.println(“Funky");
System.out.println(Monkey");
//Declare x here
if (x
3){
System.out.println(“Funky");
System.out.println(“Monkey");
}
Transcribed Image Text://Declare x here if (x == 3) System.out.println(“Funky"); System.out.println(Monkey"); //Declare x here if (x 3){ System.out.println(“Funky"); System.out.println(“Monkey"); }
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage