zondag 24 april 2011

Boolean ArrayList example

I could not get Arraylists with Booleans working so I looked it up on the Internet.

Below a example of how to use Boolean ArrayLists.

import java.awt.*;
import java.applet.*;
import java.util.ArrayList;

public class BooleanArrayList01 extends Applet {

ArrayList<Boolean> bools = new ArrayList<Boolean>();

public void init() {

bools.add(true);
System.out.println(""+bools.get(0));

}

public void paint(Graphics g) {

g.drawString("Welcome to Java!!", 50, 60 );

}

Geen opmerkingen:

Een reactie posten