Incompatible Types - found:int required:boolean

后端 未结 3 1192
爱一瞬间的悲伤
爱一瞬间的悲伤 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:32

    The expression number=number2 is an assignment expression producing an integer. But a boolean is expected in this context. You want == instead of =. Common mistake.

提交回复
热议问题