摘要:
循环(九) while和do-whlie循环 package com.luca.structs; public class WhileDemo1 { public static void main(String[] args) { //计算1到100的总和 int i = 0; int sum = 阅读全文
摘要:
运算符 import java.lang.Math; public class Demo5 { public static void main(String[] args) { // + - * / % 基础的运算符不谈 // ++ -- int a = 1; int b = a++; //a赋值给 阅读全文
摘要:
常量与变量(四) public class Demo4 { //常量用final关键字,变量名大写 static final double PI = 3.14; //类变量,在类中可以直接使用 static int age = 10; float height = 180; public stati 阅读全文
摘要:
Hello,World 打印Hello World 使用记事本创建一个文本,名称改为Hello.java(注意,后缀是.java) 在记事本中输入如下代码,并保存 public class Hello{ public static void main(String[] args){ System.o 阅读全文