AClass [] z = {new AClass(), new AClass(3.3, "hello", 3), new AClass() }; ArrayList<String> a1 = new ArrayList <String>(); a1.add("red"); a1.add("green"); String a = a1.get(1); system.out.println(a); a.indexOf("yellow"); int []intAr = { 3, 7, 9, 23, 2 };int [][]a = new int [3] [5]; initializing = double [][]b = { {1.0, 3.4}, {5.6, 8.9} };for(double [ ] row : b ) {
for(double x : row ) {
System.out.print( x + " " );
}
System.out.println();
}
public void actionPerformed (ActionEvent event) {
if (event.getSource() == left)
label.setText( "Left" );
else
label.setText( "Right" );
}
ArrayList()void add (Object obj)void add(int index, Object object)void clear()Object remove (int index)Object get (int index)int indexOf(Object obj)boolean contains(Object obj)boolean isEmptyint size()for(int row = 0; row < b.length; row++) {
for(int col = 0; col < b[row].length; col++){
System.out.print( b[row] [col ] + " ");
}
System.out.println();
}
add(b5.BorderLayout.East)No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.