i wrote this code in java and i was thinking about what's the difference between making this: String [] whatever
and String whatever []
, if someone could told me what's happening, it's better use String [] whatever
= {} or use String whatever[]
= {} or this it's just deprecated.
public class Snippet136
{
public static void main(String [] args)
{
String names[] = {"Jhonny", "Edurardo", "Francis", "Franklin", "Freedy"};
String [] eyes_colors = { "blue", "red", "black", "green", "black"};
System.out.print("Names:");
for (String name: names) {
System.out.print( " " + name );
}
System.out.print("\n\nEyes colors:");
for ( String eyes_color: eyes_colors ) {
System.out.print( " " + eyes_color );
}
}
}