java - Allocate a double-String-Array -
I want to create a new string [] [], but Eclipse gives me an error:
< Pre> Public Class Course Vita {String [] [] Education = New String [2] [6]; // Here the error throws and "{" but why? Education [0] [0] = "10/2012 - Heat"; Education [0] [1] = "studium der informative"; Education [0] [2] = "Johannes Gutenberg-University in the MEN \\"; Education [0] [3] = ""; Education [0] [4] = ""; Education [0] [5] = ""; Education [1] [0] = "10/2005 - 5/2012"; Education [1] [1] = "abtutur"; Education [1] [2] = "Muppet-Gymnasium"; Education [1] [3] = "Note: 1,3"; Education [1] [4] = ""; Education [1] [5] = "";}
Your declaration is fine.
However you should use the initial block to assign your array
value.
Just attach all to education [x] [y]
Make a statement in Curtly Brackets, or take them into the constructor.
-
Initializer block example
public class curriculum vita {string [] [] education = new string [2] [6]; // initial block {education [0] [0] = "10/2012 - heat"; Education [0] [1] = "studium der informative"; Constructor example
public class curriculum {string [] [] education = new string [2] [6] ]; // Constructor public curriculum (Vitae) (Education [0] [0] = "10/2012 - Heat"; Education [0] [1] = "Studium der Informative";}}
Comments
Post a Comment