GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing raw.githubusercontent.com — raw.githubusercontent.com

import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.List; // HW - // WAP a Java program which will create a list of int, string and decimal numbers using arraylist and linkedlists public class list_1 { public static void main(String[] args) { // TODO Auto-generated method stub // Array list for strings - List listStrings = new ArrayList(); listStrings.add("One"); listStrings.add("Two"); listStrings.add("Three"); listStrings.add("Four"); System.out.println(listStrings); System.out.println(listStrings.get(1)); listStrings.set(3, "Using set method!"); System.out.println(listStrings); // Array list for integers - List listIntegers = new ArrayList(); listIntegers.add(1); listIntegers.add(2); listIntegers.add(3); listIntegers.add(4); System.out.println(listIntegers); // Iterating over a list - Iterator iter = listIntegers.iterator(); while (iter.hasNext()) { System.out.println(iter.next()); } // Linked List for numbers - LinkedList numbers = new LinkedList(); numbers.add(10); numbers.add(10.32); numbers.add(45.3333333); System.out.println(numbers); } }
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.