Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I found this interesting (Java)
#1
A multidimensional array!

In the Java programming language, a multidimensional array is simply an array whose components are themselves arrays.

[lua]
class MultiDimArrayDemo {
public static void main(String[] args) {
String[][] names = {
{"Mr. ", "Mrs. ", "Ms. "},
{"Smith", "Jones"}
};
// Mr. Smith
System.out.println(names[0][0] +
names[1][0]);
// Ms. Jones
System.out.println(names[0][2] +
names[1][1]);
}
}
[/lua]
[Image: chaosthegreat.png]
Reply
#2
Lua does this too, with tables. It's awesome for semi-advanced projects. It really shortens up long lines of messy code.
Reply
#3
It's the same in most languages. Useful for lots of things.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)