10 2020 档案

摘要:第一题复制代码package com.hp.www;public class Demo2 { public static void main(String[] args) { String s = "Hello-World"; System.out.println("是否相等,-"+s.equals 阅读全文
posted @ 2020-10-19 22:39 杜广超 阅读(70) 评论(0) 推荐(0)
摘要:第七题:1.定义方法 isSXH(int num)功能:判断数字num是否是水仙花数,如果是返回true,如果不是返回false2.在主方法中,键盘录入数据,调用isSXH方法,判断传入的数据是否为水仙花数,如果是就输出"xxx为水仙花数",否则就输出"xxx不是水仙花数"演示: 请输入一个三位整数 阅读全文
posted @ 2020-10-18 22:37 杜广超 阅读(141) 评论(0) 推荐(0)
摘要:第一题:分析以下需求,并用代码实现手机类Phone属性:品牌brand价格price行为:打电话call()发短信sendMessage()玩游戏playGame()要求:1.按照以上要求定义类,属性要私有,生成空参、有参构造,setter和getter方法2.定义测试类,在main方法中创建该类的 阅读全文
posted @ 2020-10-16 13:19 杜广超 阅读(153) 评论(0) 推荐(0)
摘要:第一题复制代码package com.hp.day4;import com.sun.xml.internal.fastinfoset.tools.XML_SAX_StAX_FI;public class test1 { public static void main(String[] args) { 阅读全文
posted @ 2020-10-15 13:26 杜广超 阅读(63) 评论(0) 推荐(0)
摘要:第一题 package com.hp.www; public class day3 { public static void main(String[] args) { int[] arr={2,3,4,5,6,7,8,9,10,11}; //遍历打印 // for (int i = 0; i < 阅读全文
posted @ 2020-10-14 13:24 杜广超 阅读(110) 评论(0) 推荐(0)
摘要:第一题: 看程序说答案 int a = 10; int b = 3; int c = a + b; //c=13 int d = a - b; //d=7 int e = a * b; //e=30 int f = a / b; //f=3  阅读全文
posted @ 2020-10-13 13:02 杜广超 阅读(77) 评论(0) 推荐(0)