1. 1 //1三角形的定义与描述
  2. 2 package test;
  3. 3
  4. 4 public class sjx {
  5. 5 private double a,b,c;
  6. 6
  7. 7 public sjx(double a, double b, double c) {
  8. 8 this.a = a;
  9. 9 this.b = b;
  10. 10 this.c = c;
  11. 11 }
  12. 12
  13. 13 public double C(){
  14. 14 return a+b+c;
  15. 15 }
  16. 16 public double S(){
  17. 17 double p=C()*0.5;
  18. 18 double s=Math.sqrt(p*(p-a)*(p-b)*(p-c));
  19. 19 return s;
  20. 20 }
  21. 21 public void print(){
  22. 22 System.out.println(a+" "+b+" "+c+" ");
  23. 23 }
  24. 24 }
  25. 25 package test;
  26. 26
  27. 27 public class testsjx {
  28. 28
  29. 29 public static void main(String[] args) {
  30. 30 sjx sjx=new sjx(3,4,5);
  31. 31 System.out.println("三角形的三边分别为");
  32. 32 sjx.print();
  33. 33 System.out.println("三角形的周长为:"+sjx.C());
  34. 34 System.out.println("三角形的面积为:"+sjx.S());
  35. 35 }
  36. 36
  37. 37 }
  38. 38 //2.圆的定义和描述
  39. 39 package test;
  40. 40
  41. 41 public class circle {
  42. 42 private double r;
  43. 43
  44. 44 public circle(double r) {
  45. 45 this.r = r;
  46. 46 }
  47. 47 public double C(){
  48. 48 return 2*r*Math.PI;
  49. 49 }
  50. 50 public double S(){
  51. 51 return Math.PI*r*r;
  52. 52 }
  53. 53 public void output(){
  54. 54 System.out.println("圆的的半径为"+r+"\n"+"圆的周长为:"+C()+"\n"+"圆的面积为:"+S());
  55. 55 }
  56. 56
  57. 57 }
  58. 58 package test;
  59. 59
  60. 60 public class testcircle {
  61. 61
  62. 62 public static void main(String[] args) {
  63. 63 circle circle=new circle(4);
  64. 64 circle.output();
  65. 65
  66. 66 }
  67. 67
  68. 68 }
  69. 69 //3.圆柱的定义和描述
  70. 70 package test;
  71. 71
  72. 72 public class yz {
  73. 73 private double r,h;
  74. 74
  75. 75 public yz(double r, double h) {
  76. 76 this.r = r;
  77. 77 this.h = h;
  78. 78 }
  79. 79 public double DC(){
  80. 80 return 2*r*Math.PI;
  81. 81 }
  82. 82 public double DS(){
  83. 83 return Math.PI*r*r;
  84. 84 }
  85. 85 public double BS(){//圆柱的表面积
  86. 86 return 2*DS()+DC()*h;
  87. 87 }
  88. 88 public double V(){//圆柱的体积
  89. 89 return DS()*h;
  90. 90 }
  91. 91 public void output(){
  92. 92 System.out.println("圆柱的的半径为"+r+"\n"+"圆柱的高为"+h+"\n"+"圆柱的表面积为:"+BS()+"\n"+"圆柱的体积为:"+V());
  93. 93 }
  94. 94 }
  95. 95 package test;
  96. 96
  97. 97 public class testyz {
  98. 98
  99. 99 public static void main(String[] args) {
  100. 100 yz yz=new yz(3,4);
  101. 101
  102. 102 yz.output();
  103. 103 }
  104. 104
  105. 105 }
  106. 106 //5.图形的定义与描述
  107. 107 package test;
  108. 108
  109. 109 public class tx {
  110. 110 private String xz;//图形的形状
  111. 111 private double dx;//图形的大小
  112. 112 private String zx;//图形的存在形式,立体or平面
  113. 113 public tx(String xz, double dx, String zx) {
  114. 114 this.xz = xz;
  115. 115 this.dx = dx;
  116. 116 this.zx = zx;
  117. 117 }
  118. 118 public void output(){
  119. 119 System.out.println("图形的形状:"+xz+"\n"+"图形的大小:"+dx+"\n"+"图形的存在形式:"+zx);
  120. 120 }
  121. 121 }
  122. 122 package test;
  123. 123
  124. 124 public class testtx {
  125. 125
  126. 126 public static void main(String[] args) {
  127. 127
  128. 128 tx tx=new tx("圆形",40,"平面");
  129. 129 tx.output();
  130. 130 }
  131. 131
  132. 132 }
  133. 133 //6计算机的定义与描述
  134. 134 package test;
  135. 135
  136. 136 public class computer {
  137. 137 private String cpu;
  138. 138 private String xk;
  139. 139 private String zb;
  140. 140 public computer(String cpu, String xk, String zb) {
  141. 141 this.cpu = cpu;
  142. 142 this.xk = xk;
  143. 143 this.zb = zb;
  144. 144 }
  145. 145 public void output(){
  146. 146 System.out.println("cpu为:"+cpu+"\n"+"显卡为:"+xk+"\n"+"主板为:"+zb);
  147. 147 }
  148. 148 }
  149. 149 package test;
  150. 150
  151. 151 import java.util.Scanner;
  152. 152
  153. 153 public class testcomputer {
  154. 154
  155. 155 public static void main(String[] args) {
  156. 156 String a,b,c;
  157. 157 Scanner in=new Scanner(System.in);
  158. 158 System.out.println("请输入计算机的cpu/显卡/和主板类型:");
  159. 159 a=in.next();
  160. 160 b=in.next();
  161. 161 c=in.next();
  162. 162 computer computer=new computer(a, b, c);
  163. 163 computer.output();
  164. 164 }
  165. 165
  166. 166 }
  167. 167 //7.课程的定义和描述
  168. 168 package test;
  169. 169
  170. 170 public class kc {
  171. 171 private String lesson;//什么课
  172. 172 private String time;//什么时候上课
  173. 173 private String teacher;//什么老师教授
  174. 174 public kc(String lesson, String time, String teacher) {
  175. 175 this.lesson = lesson;
  176. 176 this.time = time;
  177. 177 this.teacher = teacher;
  178. 178 }
  179. 179 public void output(){
  180. 180 System.out.println("课程为:"+lesson+"\n"+"老师为:"+teacher+"\n"+"上课时间为:"+time);
  181. 181 }
  182. 182 }
  183. 183 package test;
  184. 184
  185. 185 public class testkc {
  186. 186
  187. 187 public static void main(String[] args) {
  188. 188 kc kc=new kc("java程序设计", "周一下午第二节和周五上午第二节", "张老师");
  189. 189 kc.output();
  190. 190 }
  191. 191
  192. 192 }
  193. 193 //8日期的定义与描述
  194. 194 package test;
  195. 195
  196. 196 public class date {
  197. 197 private String today;//今天几号
  198. 198 private String luck;//是否为吉日
  199. 199 public date(String today, String luck) {
  200. 200 this.today = today;
  201. 201 this.luck = luck;
  202. 202 }
  203. 203 public void output(){
  204. 204 System.out.println("今天几号:"+today+"\n"+"是否为吉日:"+luck);
  205. 205 }
  206. 206 }
  207. 207 package test;
  208. 208
  209. 209 public class testdate {
  210. 210
  211. 211 public static void main(String[] args) {
  212. 212 date date=new date("2020/11/06", "是");
  213. 213 date.output();
  214. 214 }
  215. 215
  216. 216 }
  217. 217 //9文件夹的定义与描述
  218. 218 package test;
  219. 219
  220. 220 public class file {
  221. 221 private String pan;//哪个盘上的文件夹
  222. 222 private String kj;//是否为可见文件夹
  223. 223 public file(String pan, String kj) {
  224. 224 this.pan = pan;
  225. 225 this.kj = kj;
  226. 226 }
  227. 227 public void output(){
  228. 228 System.out.println("哪个盘上的文件夹:"+pan+"\n"+"是否为可见文件夹:"+kj);
  229. 229 }
  230. 230 }
  231. 231 package test;
  232. 232
  233. 233 public class testfile {
  234. 234
  235. 235 public static void main(String[] args) {
  236. 236 file file =new file("D盘", "是");
  237. 237 file.output();
  238. 238 }
  239. 239
  240. 240 }
  241. 241 //10.上课的课堂的描述
  242. 242 package test;
  243. 243
  244. 244 public class kt {
  245. 245 private String teacher;// 上课老师为
  246. 246 private String qiandao;// 是否签到
  247. 247 private String homework;// 是否留家庭作业了
  248. 248
  249. 249 public kt(String teacher, String qiandao, String homework) {
  250. 250 this.teacher = teacher;
  251. 251 this.qiandao = qiandao;
  252. 252 this.homework = homework;
  253. 253 }
  254. 254 public void output(){
  255. 255 System.out.println("上课老师为:"+teacher+"\n"+"是否签到:"+qiandao+"\n"+"是否留家庭作业了:"+homework);
  256. 256 }
  257. 257 }
  258. 258 package test;
  259. 259
  260. 260 public class testkt {
  261. 261
  262. 262 public static void main(String[] args) {
  263. 263 kt kt=new kt("张老师", "是", "没有");
  264. 264 kt.output();
  265. 265 }
  266. 266
  267. 267 }
  268. 268 //11.手机的定义与描述
  269. 269 package test;
  270. 270
  271. 271 public class phone {
  272. 272 private String user;//使用者
  273. 273 private int G;//几G手机
  274. 274 private int rom;//存储空间多大
  275. 275 private int ram;//运行内存多大
  276. 276 public phone(String user, int g, int rom, int ram) {
  277. 277 this.user = user;
  278. 278 G = g;
  279. 279 this.rom = rom;
  280. 280 this.ram = ram;
  281. 281 }
  282. 282 public void output(){
  283. 283 System.out.println("手机使用者为:"+user+"\n"+G+"G手机"+"\n"+"存储空间为:"+rom+"\n"+"运行内存为:"+ram);
  284. 284 }
  285. 285 }
  286. 286 package test;
  287. 287
  288. 288 public class phonetest {
  289. 289
  290. 290 public static void main(String[] args) {
  291. 291 phone phone=new phone("小明", 5, 512, 16);
  292. 292 phone.output();
  293. 293 }
  294. 294
  295. 295 }
  296. 296 //12.教材如何定义与描述的
  297. 297 package test;
  298. 298
  299. 299 public class textbook {
  300. 300 private String name;//书名
  301. 301 private String author;//作者
  302. 302 private String kind;//什么类别的
  303. 303 public textbook(String name, String author, String kind) {
  304. 304 this.name = name;
  305. 305 this.author = author;
  306. 306 this.kind = kind;
  307. 307 }
  308. 308 public void output(){
  309. 309 System.out.println("书名为"+name+"\n"+"作者为:"+author+"\n"+"书的类别为:"+kind);
  310. 310 }
  311. 311 }
  312. 312 package test;
  313. 313
  314. 314 public class textbooktest {
  315. 315
  316. 316 public static void main(String[] args) {
  317. 317 textbook textbook=new textbook("java", "小明", "教育用书");
  318. 318 textbook.output();
  319. 319 }
  320. 320
  321. 321 }
  322. 322 //13.班级的定义与描述
  323. 323 package test;
  324. 324
  325. 325 public class class_ {
  326. 326 private String name;//班级名字
  327. 327 private int person;//班级人数
  328. 328 private String banzhang;//班长
  329. 329 public class_(String name, int person, String banzhang) {
  330. 330 this.name = name;
  331. 331 this.person = person;
  332. 332 this.banzhang = banzhang;
  333. 333 }
  334. 334 public void output(){
  335. 335 System.out.println("班级名字为"+name+"\n"+"班长为:"+banzhang+"\n"+"班级人数为:"+person);
  336. 336 }
  337. 337 }
  338. 338 package test;
  339. 339
  340. 340 public class class_test {
  341. 341
  342. 342 public static void main(String[] args) {
  343. 343 class_ a=new class_("计算机六班", 25, "小明");
  344. 344 a.output();
  345. 345 }
  346. 346
  347. 347 }
  348. 348 //14.选课的定义与描述
  349. 349 package test;
  350. 350
  351. 351 public class xk {
  352. 352 private String time;//选课时间
  353. 353 private String bs;//系统内置的必修课
  354. 354 private String xx;//选修课
  355. 355 public xk(String time, String bs, String xx) {
  356. 356 this.time = time;
  357. 357 this.bs = bs;
  358. 358 this.xx = xx;
  359. 359 }
  360. 360 public void output(){
  361. 361 System.out.println("选课时间为"+time+"\n"+"必修课为:"+bs+"\n"+"选修课为:"+xx);
  362. 362 }
  363. 363 }
  364. 364 package test;
  365. 365
  366. 366 public class xktest {
  367. 367
  368. 368 public static void main(String[] args) {
  369. 369 xk a=new xk("2021年一月13日", "javaweb", "美学");
  370. 370 a.output();
  371. 371
  372. 372 }
  373. 373
  374. 374 }
  375. 375 //15.一个大学如何定义与描述
  376. 376 package test;
  377. 377
  378. 378 public class university {
  379. 379 private String local;//位于哪里
  380. 380 private String name;//大学名字
  381. 381 private int ss;//在校学生
  382. 382 public university(String local, String name, int ss) {
  383. 383 this.local = local;
  384. 384 this.name = name;
  385. 385 this.ss = ss;
  386. 386 }
  387. 387 public void output(){
  388. 388 System.out.println("大学校名为"+name+"\n"+"位于:"+local+"\n"+"在校学生人数为:"+ss);
  389. 389 }
  390. 390 }
  391. 391 package test;
  392. 392
  393. 393 public class universitytest {
  394. 394
  395. 395 public static void main(String[] args) {
  396. 396 university a=new university("泰安市", "山东农业大学", 40000);
  397. 397 a.output();
  398. 398
  399. 399 }
  400. 400
  401. 401 }
  402. 402 //1.直线方程一般式
  403. 403 package test;
  404. 404
  405. 405 import java.util.Scanner;
  406. 406
  407. 407 public class line_1 {
  408. 408 private double a;
  409. 409 private double b;
  410. 410 private double c;
  411. 411 private double x;
  412. 412 private double y;
  413. 413 public line_1(){
  414. 414 }
  415. 415 public line_1(double a, double b, double c) {
  416. 416 this.a = a;
  417. 417 this.b = b;
  418. 418 this.c = c;
  419. 419 }
  420. 420 public double getX() {
  421. 421 return x;
  422. 422 }
  423. 423 public void setX(double x) {
  424. 424 this.x = x;
  425. 425 }
  426. 426 public double getY() {
  427. 427 return y;
  428. 428 }
  429. 429 public void setY(double y) {
  430. 430 this.y = y;
  431. 431 }
  432. 432 public double d() {
  433. 433 double fm=Math.sqrt(a*a+b*b);
  434. 434 double fz=Math.abs(a*x+b*y+c);
  435. 435 return fz/fm;
  436. 436 }
  437. 437 public void jd() {
  438. 438 double xz=-c/a;//直线与x轴上的交点
  439. 439 double yz=-c/b;//直线与y轴上的交点
  440. 440 System.out.println("直线与x轴上的交点为:"+xz);
  441. 441 System.out.println("直线与y轴上的交点为:"+yz);
  442. 442 }
  443. 443 public void input() {
  444. 444 System.out.println("请输入一般式直线方程的A,B,C三个参数:");
  445. 445 Scanner in=new Scanner(System.in);
  446. 446 a=in.nextDouble();
  447. 447 b=in.nextDouble();
  448. 448 c=in.nextDouble();
  449. 449 System.out.println("宁所输入的直线方程为:"+a+"*X+"+b+"*Y+"+c+"*C"+"=0");
  450. 450 System.out.println("请输入坐标x,y以求其到直线的距离");
  451. 451 x=in.nextDouble();
  452. 452 y=in.nextDouble();
  453. 453 }
  454. 454 public void output() {
  455. 455 System.out.println("点"+"("+x+","+y+")"+"到"+a+"*X+"+b+"*Y+"+c+"*C"+"=0"+"的距离为:"+d());
  456. 456 }
  457. 457
  458. 458 }
  459. 459 package test;
  460. 460
  461. 461 public class line_1test {
  462. 462
  463. 463 public static void main(String[] args) {
  464. 464 line_1 a=new line_1();
  465. 465 a.input();
  466. 466 a.output();
  467. 467 a.jd();
  468. 468 }
  469. 469
  470. 470 }
  471. 471 //2.直线方程点斜式
  472. 472 package test;
  473. 473
  474. 474 public class line_2 {
  475. 475 private double x0, x1;
  476. 476 private double y0, y1;
  477. 477 private double k;
  478. 478
  479. 479 public line_2(double x0, double y0, double x1, double y1, double k) {
  480. 480 this.x0 = x0;
  481. 481 this.y0 = y0;
  482. 482 this.x1 = x1;
  483. 483 this.y1 = y1;
  484. 484 this.k = k;
  485. 485 }
  486. 486
  487. 487 public double d() {
  488. 488 double fm = Math.sqrt(1 + k * k);
  489. 489 double fz = Math.abs(k * x1 - y1 + y0 - k * x0);
  490. 490 return fz / fm;
  491. 491 }
  492. 492 public void output() {
  493. 493 System.out.println("点"+"("+x1+","+y1+")"+"到直线y-2=2*(x-1)"+"的距离为:"+d());
  494. 494 }
  495. 495 }
  496. 496 package test;
  497. 497
  498. 498 public class line_2test {
  499. 499
  500. 500 public static void main(String[] args) {
  501. 501 line_2 a=new line_2(1, 2, 3, 4, 2);
  502. 502 a.output();
  503. 503 }
  504. 504
  505. 505 }
  506. 506 //3.直线方程截距式
  507. 507 package test;
  508. 508
  509. 509 public class line_3 {
  510. 510 private double a,b,x,y;
  511. 511
  512. 512 public line_3(double a, double b, double x, double y) {
  513. 513 this.a = a;
  514. 514 this.b = b;
  515. 515 this.x = x;
  516. 516 this.y = y;
  517. 517 }
  518. 518 private double d() {
  519. 519 double fm = Math.sqrt(a*a+b*b);
  520. 520 double fz = Math.abs(b*x+a*y-a*b);
  521. 521 return fz / fm;
  522. 522 }
  523. 523 public void output() {
  524. 524 System.out.println("点"+"("+x+","+y+")"+"到直线x/1+y/2=1"+"的距离为:"+d());
  525. 525 }
  526. 526 }
  527. 527 package test;
  528. 528
  529. 529 public class line_3test {
  530. 530
  531. 531 public static void main(String[] args) {
  532. 532 line_3 a=new line_3(1, 2, 3, 4);
  533. 533 a.output();
  534. 534 }
  535. 535
  536. 536 }
  537. 537 //4.直线方程斜截式
  538. 538 package test;
  539. 539
  540. 540 public class line_4 {
  541. 541 private double k, b, x, y;
  542. 542
  543. 543 public line_4(double k, double b, double x, double y) {
  544. 544 this.k = k;
  545. 545 this.b = b;
  546. 546 this.x = x;
  547. 547 this.y = y;
  548. 548 }
  549. 549
  550. 550 private double d() {
  551. 551 double fm = Math.sqrt(1 + k * k);
  552. 552 double fz = Math.abs(k * x - y + b);
  553. 553 return fz / fm;
  554. 554 }
  555. 555
  556. 556 public void output() {
  557. 557 System.out.println("点" + "(" + x + "," + y + ")" + "到直线y=1*x+b" + "的距离为:" + d());
  558. 558 }
  559. 559 }
  560. 560 package test;
  561. 561
  562. 562 public class line_4test {
  563. 563
  564. 564 public static void main(String[] args) {
  565. 565 line_4 a=new line_4(1, 2, 3, 4);
  566. 566 a.output();
  567. 567 }
  568. 568
  569. 569 }
  570. 570 //5.直线方程两点式
  571. 571 package test;
  572. 572
  573. 573 public class line_5 {
  574. 574 private double x,y,x1,y1,x2,y2;
  575. 575 public line_5(double x, double y, double x1, double y1, double x2, double y2) {
  576. 576 this.x = x;
  577. 577 this.y = y;
  578. 578 this.x1 = x1;
  579. 579 this.y1 = y1;
  580. 580 this.x2 = x2;
  581. 581 this.y2 = y2;
  582. 582 }
  583. 583 private double d() {
  584. 584 double k=(y2-y1)/(x2-x1);
  585. 585 double fm = Math.sqrt(1 + k * k);
  586. 586 double fz = Math.abs(k * x - y + y1 - k * x1);
  587. 587 return fz / fm;
  588. 588 }
  589. 589 public void output() {
  590. 590 System.out.println("点" + "(" + x + "," + y + ")" + "到直线(y-4)/(6-4)=(x-3)/(5-3)" + "的距离为:" + d());
  591. 591 }
  592. 592 }
  593. 593 package test;
  594. 594
  595. 595 public class line_5test {
  596. 596
  597. 597 public static void main(String[] args) {
  598. 598 line_5 a=new line_5(6, 5, 3, 4, 5, 6);
  599. 599 a.output();
  600. 600 }
  601. 601
  602. 602 }
  603. 603 //定义素数
  604. 604 package test;
  605. 605
  606. 606 public class sushu {
  607. 607 private int i,j,l,r;
  608. 608 public sushu() {
  609. 609
  610. 610 }
  611. 611
  612. 612 public int getL() {
  613. 613 return l;
  614. 614 }
  615. 615
  616. 616 public void setL(int l) {
  617. 617 this.l = l;
  618. 618 }
  619. 619
  620. 620 public int getR() {
  621. 621 return r;
  622. 622 }
  623. 623
  624. 624 public void setR(int r) {
  625. 625 this.r = r;
  626. 626 }
  627. 627
  628. 628 public sushu(int l, int r) {
  629. 629 this.l = l;
  630. 630 this.r = r;
  631. 631 }
  632. 632
  633. 633 public void fun() {
  634. 634 int count=0;
  635. 635 int m=l;
  636. 636 if(l==1) {
  637. 637 l=2;
  638. 638 }
  639. 639 System.out.println(m+"到"+r+"之间的素数为:");
  640. 640 for(i=l;i<=r;++i) {
  641. 641 int t=0;
  642. 642 for(j=2;j<=Math.sqrt(i);++j) {
  643. 643 if(i%j==0) {
  644. 644 ++t;
  645. 645 }
  646. 646 }
  647. 647 if(t==0) {
  648. 648
  649. 649 System.out.print(i+" ");
  650. 650 count++;
  651. 651 if(count%5==0) {
  652. 652 System.out.println();
  653. 653 }
  654. 654 }
  655. 655 }
  656. 656 }
  657. 657
  658. 658
  659. 659 }
  660. 660 package test;
  661. 661
  662. 662 import java.util.Scanner;
  663. 663
  664. 664 public class sushutest {
  665. 665
  666. 666 public static void main(String[] args) {
  667. 667 System.out.println("请输入宁想取那段区间的素数:");
  668. 668 Scanner in=new Scanner(System.in);
  669. 669 int l=in.nextInt();
  670. 670 int r=in.nextInt();
  671. 671 sushu a=new sushu(l, r);
  672. 672 a.fun();
  673. 673 }
  674. 674
  675. 675 }

java实验作业类的定义与描述的更多相关文章

  1. 简单练习题2编写Java应用程序。首先定义一个描述银行账户的Account类,包括成员变 量“账号”和“存款余额”,成员方法有“存款”、“取款”和“余额查询”。其次, 编写一个主类,在主类中测试Account类的功能

    编写Java应用程序.首先定义一个描述银行账户的Account类,包括成员变 量“账号”和“存款余额”,成员方法有“存款”.“取款”和“余额查询”.其次, 编写一个主类,在主类中测试Account类的 ...

  2. java问题:类的定义,对象的定义?

    java问题:类的定义,对象的定义? 类是一组数据和函数的集合,只是抽象的概念,它的作用就是生成对象,它生成对象后,就为这个对象分了一块存储区,类可以生成无限多个对象,每个对象都有自己的存储区,在类里 ...

  3. Java中主类中定义方法加static和不加static的区别

     Java中主类中定义方法加static和不加static的区别(前者可以省略类名直接在主方法调用(类名.方法),后者必须先实例化后用实例调用) 知识点:1.Getter and Setter 的应用 ...

  4. 1903021116—吉琛—Java第六周作业—类的定义

    项目 内容 课程班级博客链接 19信计班 这个作业要求链接 第六周作业链接 java面向对象的概念和定义 博客名称 学号-姓名-Java第六周作业-题目自拟 要求 每道题要有题目,代码(使用插入代码, ...

  5. 第十八周java实验作业

    实验十八  总复习 实验时间 2018-12-30 1.实验目的与要求 (1) 综合掌握java基本程序结构: (2) 综合掌握java面向对象程序设计特点: (3) 综合掌握java GUI 程序设 ...

  6. 第八周Java实验作业

    实验六 接口的定义与使用 实验时间 2018-10-18 1.实验目的与要求 (1) 掌握接口定义方法: 声明:  public interface 接口名 {...} 接口体中包含常量定义和方法定义 ...

  7. 第七周java实验作业

    实验七 继承附加实验实验时间 2018-10-11 1.实验目的与要求 (1)进一步理解4个成员访问权限修饰符的用途: Public  该类或非该类均可访问 Private  只有该类可以访问 Pro ...

  8. 这次齐了!Java面向对象、类的定义、对象的使用,全部帮你搞定

    概述 Java语言是一种面向对象的程序设计语言,而面向对象思想是一种程序设计思想,我们在面向对象思想的指引下, 使用Java语言去设计.开发计算机程序. 这里的对象泛指现实中一切事物,每种事物都具备自 ...

  9. Java实验项目三——面向对象定义职工类和日期类

    Program:按照如下要求设计类: (1)设计一个日期类,用于记录年.月.日,并提供对日期处理的常用方法. (2)设计一个职工类,该职工类至少具有下面的属性:职工号,姓名,性别,生日,工作部门,参加 ...

随机推荐

  1. 小白:String函数总结

    string.h函数: 1.strlen 数出字符串存在多少字符: 2.strcmp 比较两个字符串,若相等返回0不相等返回1 3.strcpy(char *restrict dst,const ch ...

  2. Linux 网络编程的5种IO模型:多路复用(select/poll/epoll)

    Linux 网络编程的5种IO模型:多路复用(select/poll/epoll) 背景 我们在上一讲 Linux 网络编程的5种IO模型:阻塞IO与非阻塞IO中,对于其中的 阻塞/非阻塞IO 进行了 ...

  3. pyspark计算最大值、最小值、平均值

    需求:使用pyspark计算相同key的最大值.最小值.平均值 说明: 最大值和最小值好计算,直接reduceByKey后使用python内置的max.min方法 平均值计算提供两种计算方法,直接先上 ...

  4. uniapp使用axios以及封装错误重试解决方案

    在uniapp中,使用axios进行请求时,uniapp无法使用axios的适配器,需要基于uni.request来定义适配器. 安装完成axios后在项目utils目录下建一个axios文件夹 文中 ...

  5. 【SpringBoot】14. SpringBoot多环境配置

    SpringBoot多环境配置 Spring Boot 1.5.19.RELEASE 假设项目中需要3个环境--开发.测试.生产 profile :代表的就是一个环境变量 语法结构:applicati ...

  6. C#两行代码实现三维地球

    一.             为什么要用三维地球? 三维地球是地理信息技术的一个重要发展方向,相比较二维地图技术,三维地球最大的特点是更直观更形象地表达地理信息和空间上的方位.我们可以在三维气象模拟. ...

  7. Visual Studio空格变成点的快捷键切换

    [Ctrl + R + W] 效果如下图

  8. 内网渗透 day4-meterpreter基本命令

    meterpreter基本命令 目录 1.getuid 查看当前用户 1 2.getpid 查看当前的进程id 1 3.getsystem 初步提权 1 4.ps 1.查看进程列表2.帮助我们获取pi ...

  9. VC6最基本

    高级语言C++程序设计[chap4][p119-1][我的自考书-刘璟周玉龙书] 1.VC6使用: <1>.编译:"Build"-->"Compile& ...

  10. 包装类和基本数据类型(以int和Integer为例)

    Java的包装类就是可以直接将简单类型的变量表示为一个类.java共有六个包装类:Integer,Long,Float,Double,Character,Boolean,对应六种基本数据类型. 包装类 ...