Answer to Question #152280 in Java | JSP | JSF for Hamza saeed

Question #152280
. Find the syntax errors in the definition of the following class:
public class BB
{
private int one;
private int two;
public boolean equal()
{
return (one == two);
}
public print()
{
System.out.println(one + " " + two);
}
public BB(int a, int b)
{
one = a;
two = b;
}
}
1
Expert's answer
2020-12-20T07:55:44-0500
public class BB
{

  private int one;

  private int two;

  public boolean equal ()
  {

    return (one == two);

  }

  public print ()//missing retur type
  {

    System.out.println (one + " " + two);

  }

  public BB (int a, int b)
  {

    one = a;

    two = b;

  }

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog