Previous Section  < Day Day Up >  Next Section

Q&A

Q1:

Can I use the sample Java programs from the Sun Microsystems website on my own home page?

A1:

Sun encourages the use of its sample programs on websites. In addition to the programs available at http://java.sun.com, take a look at the folders that were created when you installed the Java Development Kit on your system. If you installed the demo programs along with the Kit, you will find more than two dozen sample programs along with the .java files that were used to compile them. These programs can be a valuable resource when you're working on your own Java programs later.

Q2:

What is the difference between Java applets and ActiveX controls?

A2:

ActiveX, an extension of Microsoft technology called the Component Object Model, offers support for interactive web programs that are similar in function to Java programs. They are placed on web pages and run when browsers are equipped to handle them. The primary differences are that ActiveX relies on a system to verify the identity of ActiveX programmers and ActiveX programs are not downloaded each time they are encountered. Unlike Java programs, an ActiveX program stays on a user's system. Also, an ActiveX program is not restricted in what it can do on a system, while Java programs run from web pages face very strong restrictions in what they can do.

Q3:

I ran a useful Java program on a web page. Can I run it on my system without the browser?

A3:

Under mostcircumstances, no. Java programs typically are developed to run on a web page or to run from the command line. A program can be written so that it works in both ways, but most of the programs you will find in a directory such as EarthWeb do not include this functionality. You'll learn much more about the different types of Java programs during Hour 4, "Understanding How Java Programs Work."

Q4:

What's the difference between J2SE (Java 2 Standard Edition) and J2EE (Java 2 Enterprise Edition)? Does J2EE cost money?

A4:

Java 2 Enterprise Edition is an expansion of the Java 2 Standard Edition that includes packages to support advanced technology such as Enterprise JavaBeans, XML processing, and the development of servlets, Java programs that run on a web server. J2EE also includes an application server, a sophisticated environment for executing Java software that's tailored for corporations and other large organizations with heavy computing needs. The J2EE development kit can be downloaded at no cost from Sun at http://java.sun.com/j2ee.

Q5:

Can a Java program I run on a web page give my computer a virus?

A5:

Because of general security restrictions that prevent web programs from reading, writing, or modifying files, there's no way for a virus to be transmitted from a Java program on a web page to your system unless you gave the program full permission to access the hard drive on your system. Java programs you download and run from the command line have the same risk of viruses as any program you download. If you're using programs received over the Internet, you need to acquire a good antivirus program and use it regularly.

Q6:

What makes the lights in tennis shoes light up—batteries or chemicals?

A6:

The light comes from a watch-type battery encased in a temperature-resistant epoxy that is activated when the wearer moves. A wire vibrates, completing a circuit in the battery.

These shoe batteries normally last around four to six months. They were invented by shoe company L.A. Gear.

    Previous Section  < Day Day Up >  Next Section