為什么第七行加個(gè)int 聲明,代碼就報(bào)錯(cuò)
public class HelloWorld{
??? public static void main(String[] args) {
?? ???? int one = 10 ;
??????? int two = 20 ;
??????? int three = one + two ;
??????? System.out.println(""+three);
??????? int three += one;
??????? System.out.println(""+three);
???????? three -= one;
??????? System.out.println(""+three);
???????? three *= one;
??????? System.out.println(""+three);
??????? three /= one;
??????? System.out.println(""+three);
??????? three %= one;
??????? System.out.println(""+three);
?????? ?
???????
2019-02-16
第5行已經(jīng)申明過,當(dāng)然不能重復(fù)申明了。變量只能一次申明,賦值才允許多次的。