- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
what is the simplest way to print a java array
To make things simple, convert the array to list and then print it.
Example
import java.util.Arrays; import java.util.List; public class Tester { public static void main(String[] args) { Integer[] numbers = {1,2,3,4,5}; List<Integer> list = Arrays.asList(numbers); System.out.println(list); } }
Output
[1,2,3,4,5]
- Related Articles
- What's the simplest way to print a Java array?
- What is the simplest way to SSH using Python?
- What is the simplest way to make Matplotlib in OSX work in a virtual environment?
- A drum full of kerosene catches fire. What is the simplest way to put off this fire?
- What is the simplest multi-dimensional array in C#?
- Simplest way to detect keypresses in JavaScript?
- What is the correct way to use printf to print a size_t in C/C++?
- Simplest way to detect client locale in PHP
- What is the easiest way to reverse a String in Java?
- What is the simplest solution to flat a JavaScript array of objects into an object?
- How to print a byte array in Java?
- What is the easiest way to convert a List to a Set in Java?
- What is the best way to check capacity in Java?
- The simplest way to get the user's current location on Android
- Java Program to Print the Elements of an Array

Advertisements