290114lyp

导航

2022年10月23日

Scanner进阶使用

摘要: package com.jiemo.scanner;import java.util.Scanner;public class Shabi3 { public static void main(String[] args) { Scanner scanner =new Scanner(System. 阅读全文

posted @ 2022-10-23 19:59 是芥末!日 阅读(13) 评论(0) 推荐(0) 编辑

next和nextline

摘要: package com.jiemo.scanner;import java.util.Scanner;public class Shabi1 { public static void main(String[] args) { //创建一个扫描器对象,用于接收键盘数据 Scanner scanner 阅读全文

posted @ 2022-10-23 16:23 是芥末!日 阅读(18) 评论(0) 推荐(0) 编辑

Javados建立文档

摘要: package com.jiemo.base;/** * @author shabi *@version 1.0 *@since 1.8 */public class Doc { String name; /** * @author shabi * @param name * @return * @ 阅读全文

posted @ 2022-10-23 15:49 是芥末!日 阅读(15) 评论(0) 推荐(0) 编辑

包机制

摘要: ◆为了更好地组织类,Java提供了包机制,用于区别类名的命名空间。 ◆包语句的语法格式为: package pkg1[. pkg2[. k3...]]; ◆- -般利用公司域名倒作为包名; ◆为 了能够使用某一个包的成员, 我们需要在Java程序中明确导入该包。使用"import"语句可完成此功能 阅读全文

posted @ 2022-10-23 15:01 是芥末!日 阅读(12) 评论(0) 推荐(0) 编辑

2022年10月22日

扩展赋值运算符 条件运算符

摘要: package operator;public class Shabi7 { public static void main(String[] args) { int a=10; int b=20; a+=b;//a =a+b a-=b;//a =a-b a*=b;//a =a*b a/=b;//a 阅读全文

posted @ 2022-10-22 21:56 是芥末!日 阅读(8) 评论(0) 推荐(0) 编辑

逻辑运算符 位运算符

摘要: package operator;public class Shabi5 { public static void main(String[] args) { // 与(and) 或(or) 非(取反) boolean a=true; boolean b=false; System.out.prin 阅读全文

posted @ 2022-10-22 21:32 是芥末!日 阅读(9) 评论(0) 推荐(0) 编辑

自增 自减 幂运算

摘要: package operator;public class Sshabi4 { public static void main(String[] args) { //++ -- 自增 自减 一元运算符 int a=5; int b=a++;//执行完这行代码,先给b赋值,再自增 // a=a+1 S 阅读全文

posted @ 2022-10-22 20:51 是芥末!日 阅读(12) 评论(0) 推荐(0) 编辑

部分基本运算符

摘要: package operator; public class Shabi1 { public static void main(String[] args) { //二元运算符 //ctrl * d:复制当前到下一行 int a=10; int b=20; int c=25; int d=25; S 阅读全文

posted @ 2022-10-22 20:50 是芥末!日 阅读(11) 评论(0) 推荐(0) 编辑

变量 常量

摘要: public class shabi4 { //类变量 static static double salary =2500; //属性:变量 //实例变量:从属于对象;如果不自行初始化,这个类型的默认值 //布尔值:默认值是false //除了基本类型。其余的默认值都是null String nam 阅读全文

posted @ 2022-10-22 16:53 是芥末!日 阅读(10) 评论(0) 推荐(0) 编辑

类型转换

摘要: public class shabi1 { public static void main(String[] args) { int i =128; byte b =(byte)i;//内存溢出 //强制转换 (类型)变量名 高到低 System.out.println(i); System.out 阅读全文

posted @ 2022-10-22 15:50 是芥末!日 阅读(2) 评论(0) 推荐(0) 编辑