2021年5月14日
摘要: 目录结构: package snake; import javax.swing.*; public class StartGame { public static void main(String[] args) { JFrame frame = new JFrame("贪吃蛇"); frame.s 阅读全文
posted @ 2021-05-14 12:58 久先生 阅读(35) 评论(0) 推荐(0)
  2021年4月21日
摘要: #杨辉三角 打印10行杨辉三角 1.打印出直角杨辉三角 public class Yanghui { public static void main(String[] args) { int[][] a = new int[10][10]; for(int i=0;i<10;i++){ for(in 阅读全文
posted @ 2021-04-21 21:43 久先生 阅读(62) 评论(0) 推荐(1)
摘要: #打印乘法表 public class Multip { public static void main(String[] args) { for (int i=1;i<10;i++){ for(int j=1;j<=i;j++){ System.out.print(j + "*" + i + "= 阅读全文
posted @ 2021-04-21 21:08 久先生 阅读(56) 评论(0) 推荐(0)
  2021年4月13日
摘要: 给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 的那 两个 整数,并返回它们的数组下标。 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素在答案里不能重复出现。 你可以按任意顺序返回答案。 1 class Solution { public in 阅读全文
posted @ 2021-04-13 19:57 久先生 阅读(51) 评论(0) 推荐(0)
摘要: #Java基础1 ##注释 注释是为了增加代码可读性,并不在代码运行时编译。(给人看,便于理解) // 行内注释 /* 多行注释 */ /** 文档注释 */ ##标识符和关键字 ###标识符 标识符是用来标识变量,方法,类,对象等其他用户自定义项目的名称,给代码中的实体(如:方法名,变量名,类名, 阅读全文
posted @ 2021-04-13 16:40 久先生 阅读(39) 评论(0) 推荐(0)