1.

What Is The Statements?

Answer»

A Java program consists of instructions that you want the computer to perform. WITHIN a Java applet, you USE statements to express these instructions in a format the Java compiler understands. If you are already familiar with C/C++, you will discover that Java statements are very similar. For example, the following statements produce a PROGRAMS which prints the words "Hello, Java!" in applet window:

import java.applet.*; import java.awt.Graphics;
public class hello_java extends Applet {
public void paint(Graphics g) {
g.drawstring("Hello, Java!", 20, 20); } }

A Java program consists of instructions that you want the computer to perform. Within a Java applet, you use statements to express these instructions in a format the Java compiler understands. If you are already familiar with C/C++, you will discover that Java statements are very similar. For example, the following statements produce a programs which prints the words "Hello, Java!" in applet window:



Discussion

No Comment Found