public class HelloWorld{
public static void main(String[] args) {
final String SEX1="男";
final String SEX2="女";
System.out.println("SEX1=:"+SEX1);
System.out.println("SEX2=:"+SEX2);
}
}
public static void main(String[] args) {
final String SEX1="男";
final String SEX2="女";
System.out.println("SEX1=:"+SEX1);
System.out.println("SEX2=:"+SEX2);
}
}
2015-05-04
public class HelloWorld{
public static void main(String[] args) {
final char SEX1='男';
final char SEX2='女';
System.out.println("SEX1=:"+SEX1);
System.out.println("SEX2=:"+SEX2);
}
}
public static void main(String[] args) {
final char SEX1='男';
final char SEX2='女';
System.out.println("SEX1=:"+SEX1);
System.out.println("SEX2=:"+SEX2);
}
}
2015-05-04
public class HelloWorld{
public static void main(String[] args) {
double avg1=78.5;
int rise=5;
int avg2=(int)avg1+rise;
System.out.println("考试平均分:"+avg1);
System.out.println("调整后的平均分:"+avg2);
}
}
public static void main(String[] args) {
double avg1=78.5;
int rise=5;
int avg2=(int)avg1+rise;
System.out.println("考试平均分:"+avg1);
System.out.println("调整后的平均分:"+avg2);
}
}
2015-05-04
public class HelloWorld{
public static void main(String[] args) {
int a=12;
int b=24;
int difference=b-a;
System.out.println("两数之差为:"+difference);
}
}
public static void main(String[] args) {
int a=12;
int b=24;
int difference=b-a;
System.out.println("两数之差为:"+difference);
}
}
2015-05-04
1.首先4字节int类型不能兼容double 8字节类型;
2,int类型为整数。调整后平均分为83.5,类型只能去double或者float。
2,int类型为整数。调整后平均分为83.5,类型只能去double或者float。
2015-05-04
System.out.println("three *= one ==> "+(three *= one));
System.out.println("three /= one ==> "+(three /= one));
System.out.println("three %= one ==> "+(three %= one));
System.out.println("three /= one ==> "+(three /= one));
System.out.println("three %= one ==> "+(three %= one));
2015-05-03