摘要:
一维数组的创建方法 //第一种创建array的方法: String[] familyMembers = new String[4]; familyMembers[0] = "jerry"; familyMembers[1] = "elaine"; familyMembers[2] = "george 阅读全文
posted @ 2020-05-25 22:45
profesor
阅读(683)
评论(0)
推荐(0)
摘要:
public class Arrays { public static void main(String[] args) //返回值设为String { for (String name : names()) System.out.println(name); } public static Str 阅读全文
posted @ 2020-05-25 22:40
profesor
阅读(182)
评论(0)
推荐(0)
摘要:
//一维随机数组 public class RandomArray { public static void main(String[] args) { int[] nums = new int[(int) (Math.random() * 10)]; System.out.println("len 阅读全文
posted @ 2020-05-25 22:08
profesor
阅读(802)
评论(0)
推荐(0)
摘要:
//我们知道: Java有Math.random()来随机选择[0,1)内的任意数 //随机取数 // import java.util.Random; public class Choice { public static void main(String[] args) { Random rdm 阅读全文
posted @ 2020-05-25 21:56
profesor
阅读(2721)
评论(0)
推荐(0)
摘要:
Array of arrays: #include <stdio.h> #include <string.h> int main() { char tracks[][100] = { "will the protesters in American cities bring progress", " 阅读全文
posted @ 2020-05-25 16:27
profesor
阅读(191)
评论(0)
推荐(0)