Array (Printing Full Array)

0 Robert Summers · October 16, 2014
Okay so how do I output this

My array = 12, 25, 400, 50, 15





With this code

package myproject;

public class classOne{
  public static void main(String[] args){

     int my_array[] = {12, 25, 400, 50, 15};
     System.out.println("My array = " + my_array[]);

  }
}

Thanks for the help in return :)

Post a Reply

Replies

Oldest  Newest  Rating
0 Ibrahim Tuzlak · October 16, 2014
for / foreach loop?

package myproject;

public class classOne{
public static void main(String[] args){

int my_array[] = {12, 25, 400, 50, 15};
for (String x : my_array {
System.out.println(x);
}
}
}
  • 1

Java / Android Development

107,264 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator