摘要: package Demo505;//Math 还有很多方法,可以自行在API中查询使用public class CodeMath { public static void main(String[] args) { System.out.println(Math.abs(-6.6)); //绝对值 System.out.println(Math.ceil(6.6)... 阅读全文
posted @ 2019-05-07 22:36 Ssinoo団子 阅读(192) 评论(0) 推荐(0)
摘要: package Code506;/*继承中,区分三种变量重名局部变量: 直接写成员变量名本类的成员变量 this.成员变量名父类的成员变量 super.成员变量名 */public class DemoExtends { public static void main(String[] args) 阅读全文
posted @ 2019-05-06 19:57 Ssinoo団子 阅读(602) 评论(0) 推荐(1)
摘要: 代码运行↓ 根据运行结果可以得知 阅读全文
posted @ 2019-05-04 10:13 Ssinoo団子 阅读(299) 评论(0) 推荐(0)
摘要: package Code503;public class CodeStringGet { public static void main(String[] args) { //获取字符串的长度 int length = "huanduchenyu".length(); System.out.println("字符串的长度为:"+length); ... 阅读全文
posted @ 2019-05-03 22:40 Ssinoo団子 阅读(1943) 评论(0) 推荐(0)
摘要: package Code503;import java.util.Scanner;/*题目:统计键盘输入的一个字符串中的数字,字母大小写和其他。 */public class CodeStringCount { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); ... 阅读全文
posted @ 2019-05-03 22:38 Ssinoo団子 阅读(2092) 评论(0) 推荐(1)
摘要: package Code429;import java.util.ArrayList;public class CodeArrayListStudent { public static void main(String[] args) { ArrayList list = new ArrayList(); Student one = new Student("卢本... 阅读全文
posted @ 2019-04-29 19:45 Ssinoo団子 阅读(687) 评论(0) 推荐(0)
摘要: package Code429;import java.util.ArrayList;import java.util.Random;public class CodeArrayListPrint { public static void main(String[] args) { ArrayList biglist = new ArrayList(); Rand... 阅读全文
posted @ 2019-04-29 19:13 Ssinoo団子 阅读(1038) 评论(0) 推荐(0)
摘要: package Code428;import java.util.Scanner;public class CodeScannerMax { public static void main(String[] args) { //从键盘输入三个数字 Scanner scanner =new Scanner(System.in); int a=scanner... 阅读全文
posted @ 2019-04-28 19:43 Ssinoo団子 阅读(860) 评论(0) 推荐(0)
摘要: package Code428;import java.util.Scanner;/*Scanner 可以实现键盘输入数据引用的步骤1.import 包路径.类名称只有java.lang包下的内容不要导包,其他都需要import语句。2.创建类名称 对象名 =new 类名称();3.使用对象名.成员方法名() */public class CodeScanner { public stati... 阅读全文
posted @ 2019-04-28 19:18 Ssinoo団子 阅读(188) 评论(0) 推荐(0)
摘要: package Code426;/*1.构造方法的名称需和类名一致2.构造方法不要写返回值3.构造方法是可以重载的重载:方法名称相同,参数列表不同。 */public class Code1{ //成员变量 private int age; private String name ; public Code1() { System.out.println("无参方法... 阅读全文
posted @ 2019-04-26 20:21 Ssinoo団子 阅读(136) 评论(0) 推荐(0)