HTML Templates — php?

前端 未结 4 1516
时光说笑
时光说笑 2021-02-05 23:20

So, I\'m making a site about WWI as a school assignment, and I want this to appear in every document:





    <         


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-21 02:40

    Different Ways to Print Arrays in Java:

    1. Simple Way

      List list = new ArrayList();
      list.add("One");
      list.add("Two");
      list.add("Three");
      list.add("Four");
      // Print the list in console
      System.out.println(list);
      

    Output: [One, Two, Three, Four]

    1. Using toString()

      String[] array = new String[] { "One", "Two", "Three", "Four" };
      System.out.println(Arrays.toString(array));
      

    Output: [One, Two, Three, Four]

    1. Printing Array of Arrays

      String[] arr1 = new String[] { "Fifth", "Sixth" };
      String[] arr2 = new String[] { "Seventh", "Eight" };
      String[][] arrayOfArray = new String[][] { arr1, arr2 };
      System.out.println(arrayOfArray);
      System.out.println(Arrays.toString(arrayOfArray));
      System.out.println(Arrays.deepToString(arrayOfArray));
      

    Output: [[Ljava.lang.String;@1ad086a [[Ljava.lang.String;@10385c1, [Ljava.lang.String;@42719c] [[Fifth, Sixth], [Seventh, Eighth]]

    Resource: Access An Array

提交回复
热议问题