Sams Teach Yourself Java™ in 24 Hours (Covering Java 7 and Android)

(singke) #1
ptg7068951

46 HOUR 4:Understanding How Java Programs Work


Q&A
Q. Do all arguments sent to a Java application have to be strings?
A. Javastores all arguments as strings when an application runs. When you
want to use one of these arguments as an integer or some other non-
string type,you have to convert the value. You learn how to do this dur-
ing Hour 11,“Describing What Your Object Is Like.”

Q. If applets run on web pages and applications run everywhere else,what
are Java programs launched by Java Web Start?
A. Java Web Start is a way to launch Java applications from a web browser.
A user clicks a link on a web page to run the program,which is easier
than downloading it,running an installation wizard,and starting it like
any other desktop software.
Although they’re run from a browser,Java Web Start programs are applica-
tions instead of applets. The application’s always up-to-date because it’s
retrieved over the web from the program’s provider every time it is run.
Google Web Toolkit (GWT),a set of opensource tools for web programming,
can convert a Java program into JavaScript,making it run faster and more
reliably in web browsers without requiring a Java virtual machine.

Q. Does the line of succession to the British throne run out at some point?
A. Under Parliamentary law that has been in place since 1701,the British
monarch must be a Protestant descendant of Sophia of Hanover,a German
princess who was the heiress to the crown when the law was passed.
There are a finite number of people who are descendants of Sophia,so
there’s always somebody last in the regal line. The British government
only lists the first 38,so genealogists have attempted to fill out the rest
of the list themselves.
The last person in the line of succession is Karin Vogel,a German pain
therapist in her thirties. She was 4,973rd in line as of 2001,genealo-
gists determined after an exhaustive search that took years. So if all the
people ahead of her drop out of the running (to,say,spend more time
learning Java programming),Vogel takes over the mor tgage of
Buckingham Palace and becomes Her Majesty Karin the First.
Vogel is Sophia’s great-great-great-great-great-great-great-great-grand-
daughter. She told the Wall Street Journalthat becoming monarch would
be “too stressful.”
If by the time you read this Prince William and Princess Kate have pro-
duced a Protestant child,Vogel drops to 4,974.
Free download pdf