![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
Austim小白
懒
展开
-
复制俩个数组元素
public class text { public static void main(String[] args) { int arr1[]={1,2,3,4,5}; int arr2[]= new int[arr1.length] ; copy(arr1,arr2); printArray(arr1); printArray(arr2); } public static void printA...原创 2022-01-19 21:04:07 · 419 阅读 · 0 评论 -
购物车修改学习笔记
package com.itheima.demo;public class Goods{ private int id;//编号 private String name;//名称; private double price; private int buyNumber;//购买数量 public Goods() { } public Goods(int id, String name, double price, int buyNum..原创 2022-01-19 20:16:45 · 125 阅读 · 0 评论 -
面向对象——购物车模拟
package com.itheima.demo;public class Goods { int id;//编号 String name;//名称; double price; int buyNumber;//购买数量}package com.itheima.demo;import java.util.Scanner;public class ShopCarTest { public static void main(String[] args) {原创 2022-01-19 10:09:13 · 159 阅读 · 0 评论 -
生成指定区间随机数
public static void main(String[] args) { //创建随机数对象 Random r = new Random(); for (int i = 0; i < 10; i++) { int data = r.nextInt(10, 30); System.out.println(data); }...原创 2022-01-16 21:19:27 · 121 阅读 · 0 评论