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
> 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));
}