A Funny Java Flavoured Look at the World

Saturday, April 29, 2006

Free PDF - varargs sample chapter

I have found a link to a sample chapter on the Java 5 feature - vararg also known as Variable arguments. This is also on the Java 5 SCJP Exam so anyone studying for that should give this chapter a read.

The chapter is from the book Java 5.0 Tiger: A Developer's Notebook By David Flanagan, Brett McLaughlin. The chapter talks about how to create and use variable-length arguments list. So it's a good resource for people wanting to study varargs for the SCJP Java 5 exam and also for people who are interested in writing varags code and using varargs

if you want a bit more VarArg action

There is also to a sun's tutorial on VarArgs this is from there Tech Tips news letter

VarArgs for people who haven't used them, allows you to pass a number (one or more) of types of objects into a method. So a simple example would be passing people's names into a method, some people who have one name e.g. Madonna (1 String) some people could have names with lots of middle names e.g. Benjamin James Hosking(5). It's quite a good feature and is quite useful in certain situations and better than having an array variable.

here is the link

http://www.onjava.com/catalog/javaadn/excerpt/javaadn_ch05.pdf

I hope it helps all you people studying for the Java 5 exam

0 Comments:

Post a Comment

<< Home