public class Process {
public static void main(String[] args){
//Java的三种输入方式
/*
* System.out.println("Hello World!");
* System.out.print("Hello World!");
* String str = "Hello World";
*
* System.out.printf("%s",str);
*/
int a = 230000;
System.out.println(a);
double b = 2.3434;
System.out.printf("%d\n",a);
System.out.printf("%.2f",b);
/*
* %d 格式化输出整数
* %x 格式化输出十六进制整数
* %f 格式化输出浮点数
* %e 格式化输出科学计数法表示的浮点数
* %s 格式化字符串
* 和c语言一样了
* */
String str1 = "hello";
String str2 = "hello";
if(str1==str2){
System.out.println("相等");
}else{
System.out.println("不相等");
}
// 那么str1&
java自学知识点笔记:流程控制
最新推荐文章于 2022-07-04 18:44:57 发布