What will be the output of the following Java program? class main class public static void main(String args[]) { int x = 9; if (x=9) { int x = 8; System.out.println(x);

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Question
i need the answer quickly
What will be the output of the following Java program?
class main class
public static void main(String args[])
{
int x = 9;
if (x=9)
int x = 8;
System.out.println(x).
}
Select one:
O a. Runtime error
O b. 8
O c. Compilation error
O d. 9
Transcribed Image Text:What will be the output of the following Java program? class main class public static void main(String args[]) { int x = 9; if (x=9) int x = 8; System.out.println(x). } Select one: O a. Runtime error O b. 8 O c. Compilation error O d. 9
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT