5 years ago in Java Classes And Methods

What is the output of this program?
class equality {

int x;

int y;

boolean isequal(){

return(x == y);

}

}

class Output {

public static void main(String args[])

{

equality obj = new equality();

obj.x = 5;

obj.y = 5;

System.out.println(obj.isequal); }

}

[A] false
[B] true
[C] 0
[D] 1
Loading...
Next Question

Overall Stats

Attempted 175
Correct 92
Incorrect 20
Viewed 63

Answers

Guest
Guest
Zo Go
Zo Go - 1 month ago

Zo Go from Casablanca, Morocco is saying true is correct answer

Assaad Amine
Assaad Amine - 1 month ago

Assaad Amine from Casablanca, Morocco is saying true is correct answer

Awa Kone
Awa Kone - 1 month ago

Awa Kone from Berrechid, Morocco is saying true is correct answer

ayoub benigmim
ayoub benigmim - 1 month ago

ayoub benigmim from Casablanca, Morocco is saying true is correct answer

AHMED SOULIMANI
AHMED SOULIMANI - 1 month ago

AHMED SOULIMANI from Casablanca, Morocco is saying true 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

Which of these statement is incorrect?

  • [A] All object of a class are allotted memory for the all the variables defined in the class.
  • [B] If a function is defined public it can be accessed by object of other class by inheritance.
  • [C] main() method must be made public.
  • [D] All object of a class are allotted memory for the methods defined in the class.