6 years ago in Java Classes And Methods

What is the output of this program?
class Output {

static void main(String args[])

{

int x , y = 1;

x = 10;

if (x != 10 && x / 0 == 0)

System.out.println(y);

else

System.out.println(++y);

}

}

[A] 1
[B] 2
[C] Runtime Error
[D] Compilation Error
Loading...
Next Question

Create your Digital Resume For FREE on your name's sub domain "yourname.wcard.io". Register Here!


Overall Stats

Attempted 96
Correct 11
Incorrect 45
Viewed 40

Answers

Guest
Guest
Nikhil Jain
Nikhil Jain - 4 years ago

Nikhil Jain from Pune, India is saying 2 is correct answer

Enas Adel
Enas Adel - 4 years ago

Enas Adel from Giza, Egypt is saying 2 is correct answer

Mina Atef
Mina Atef - 4 years ago

Mina Atef from Cairo, Egypt is saying Compilation Error is correct answer

Kuheli Mitra
Kuheli Mitra - 4 years ago

Kuheli Mitra from Bangalore, India is saying Runtime Error is correct answer

Ahmed Ashfaqh
Ahmed Ashfaqh - 4 years ago

Ahmed Ashfaqh from Mississauga, Canada is saying Runtime Error is correct answer

Related Questions

Which interface provides the capability to store objects using a key-value pair?

  • [A] Java.util.Map
  • [B] Java.util.Set
  • [C] Java.util.List
  • [D] Java.util.Collection

String in Java is a?

  • [A] class
  • [B] object
  • [C] variable
  • [D] character array

Which of these class relies upon its subclasses for complete implementation of its methods?

  • [A] Object class
  • [B] abstract class
  • [C] ArrayList class
  • [D] None of the mentioned

Which of these method of Object class is used to obtain class of an object at run time?

  • [A] get()
  • [B] void getclass()
  • [C] Class getclass()
  • [D] None of the mentioned