JShell: representation of array values

Remi Forax forax at univ-mlv.fr
Thu Sep 22 05:40:47 UTC 2016


Yes !

Rémi 

On September 22, 2016 3:16:58 AM GMT+02:00, Robert Field <robert.field at oracle.com> wrote:
>JavaOne demos made it clear we need a friendlier representation of
>array 
>values.
>
>Current --
>
>jshell> new String[] { "hi", "low", null }
>$2 ==> [Ljava.lang.String;@ae45eb6
>
>jshell> new char[] { 'a', 34, 77 }
>$3 ==> [C at 27efef64
>
>I'm proposing this --
>
>jshell> new int[4]
>$1 ==> int[4] { 0, 0, 0, 0 }
>
>jshell> new int[0]
>$2 ==> int[0] {  }
>
>jshell> new String[] { "hi", "low", null }
>$3 ==> String[3] { "hi", "low", null }
>
>jshell> new char[] { 'a', 34, 77 }
>$4 ==> char[3] { 'a', '"', 'M' }
>
>jshell> new int[][] { new int[] {44, 55}, new int[] {88,99}}
>$5 ==> int[][2] { int[2] { 44, 55 }, int[2] { 88, 99 } }
>
>jshell> new Object[] { "howdy", new int[] { 33, 44, 55 }, new String[]
>{ 
>"up", "down" }}
>$6 ==> Object[3] { "howdy", int[3] { 33, 44, 55 }, String[2] { "up", 
>"down" } }
>
>jshell> new int[100000]
>$7 ==> int[100000] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
>
>0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
>
>0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
>
>0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
>
>0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
>
>0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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