Q&A
-
Can I use the sample Java programs from the Sun Microsystems Web site on my own home page?
-
Sun encourages the use of its sample programs on Web sites. In addition to the programs available at http://java.sun.com, take a look at the folders that were created when you installed the Software 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.
-
What is the difference between Java applets and ActiveX controls?
-
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.
-
I ran a useful Java program on a Web page. Can I run it on my system without the browser?
-
Under most circumstances, 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."
-
Is there a print edition of JavaWorld?
-
JavaWorld is distributed strictly through the World Wide Web. However, several newsstand magazines are available that cover the language, including Java Report, Java Developer's Journal, Dr. Dobb's Journal, and others.
-
Can a Java program I run on a Web page give my computer a virus?
-
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.