Long story short, you can’t easily print an array in java. Do this:
System.out.println( Arrays.toString(answer) );
More Related Contents:
- Multiplication based on input integer and return array- Need help in storing array while looping
- How to check two array list are same content in same position
- How to refacor a code use only loops and simple arrays?
- Why Java Only Allows String[] args as Main method Argument? [duplicate]
- I have a function in java which may have bug and I can not find it [closed]
- Arrays.asList() not working as it should?
- How to convert jsonString to JSONObject in Java
- Array or List in Java. Which is faster?
- A quick and easy way to join array elements with a separator (the opposite of split) in Java [duplicate]
- How to supply value to an annotation from a Constant java
- What is this: [Ljava.lang.Object;?
- Immutable array in Java
- Quickest way to find missing number in an array of numbers
- Lambda expression to convert array/List of String to array/List of Integers
- Using GSON to parse a JSON array
- Converting String to “Character” array in Java
- pass array to method Java
- Byte Array to Image object
- String array initialization in Java [duplicate]
- Print ArrayList
- Issue with parsing the content from JSON file with Jackson & message- JsonMappingException -Cannot deserialize as out of START_ARRAY token
- Print array without brackets and commas
- Sort a parallel array using Arrays.sort()
- When to use a List over an Array in Java?
- Looping through the elements in an array backwards [duplicate]
- Sorting int array in descending order [duplicate]
- How do I create an int array with randomly shuffled numbers in a given range [duplicate]
- Return the index of clicked button?
- what is Ljava.lang.String;@
- java : Understanding Arrays.asList(T…array) method for primitive types