Question: What will be the output of the following Java program? class equality { int x; int y; boolean isequal() { return(x == y); } }

What will be the output of the following Java program?

  1. class equality 
  2.  {
  3.  int x;
  4.  int y;
  5.  boolean isequal()
  6.  {
  7.  return(x == y); 
  8.  } 
  9.  } 
  10.  class test
  11.  {
  12.  public static void main(String args[])
  13.  {
  14.  equality obj = new equality();
  15.  obj.x = 5;
  16.  obj.y = 6;
  17.  System.out.println(obj.isequal());
  18.  } 
  19.  }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!