Incompatible Types - found:int required:boolean

后端 未结 3 1202
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-22 03:00

I\'m trying to display: EQUIVALENT if the first numerical input is equal to the second input. What\'s wrong with my code?

import java.io.*;
public class TwoNum{
         


        
3条回答
  •  悲&欢浪女
    2021-01-22 03:41

    Your first condition should be:

    if(number==number2)
    

    In if condition use == to compare 2 integers. Also don't use if in both condition use else if(). Using if in both will check condition for both even though first condition is true it will check for second condition and you are missing 3rd condition for LESS THAN.

提交回复
热议问题