- 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]
Advertisements