Few general questions and j2sdk 5 questions

Hello guys

I hope the new java development kit have some way to deal with scanner's TWAIN. Does it?

What is the new Each-for loop used for?

I googled the internet and not find any site that provides me with final reports to Seniors presented by Computer Science Students, is there any?

With Regards

M. Tleis

[345 byte] By [Java_scientist] at [2007-9-30 21:40:52]
# 1

> I hope the new java development kit have some way to

> deal with scanner's TWAIN. Does it?

No. TWAIN is a Windows only standard, hence standard Java can't support it. There are third party libraries (such as Morena - http://www.gnome.sk/Twain/jtp.html) you can use to interface with TWAIN though.

> What is the new Each-for loop used for?

Foreach loops are a syntactic sugar that simplify looping over collections. In Java before version 5, you might have written code like this:

List things = new ArrayList();

things.add("abc");

things.add("def");

things.add("123");

for (Iterator i = things.iterator(); it.hasNext();)

{

String thing = (String)it.next();

System.out.println(thing.charAt(0));

}

Java 5.0 lets you do the following:

List<String> things = new ArrayList<String>();

things.add("abc");

things.add("def");

things.add("123");

for (String thing: things)

{

System.out.println(thing.charAt(0));

}

philip_ross at 2007-7-7 3:10:46 > top of Java-index,Administration Tools,Sun Connection...