Java Tutorial 1
来源:互联网 发布:校园app 软件下载 编辑:程序博客网 时间:2024/06/07 21:13
- Java is a OOP language
- object is a self-contained entity which has its own private collection of properties (ie. data) and methods (ie. operations) that encapsulate functionality into a reusable and dynamically loaded structure.
- Applications are stand alone and are invoked (or executed) by using a Java interpreter.
/**
* The HelloWorldApp class implements an application
* that displays "Hello World!" to the standard output.
*/
public class HelloWorldApp {
public static void main(String args[])
{
// Display Hello World! now
System.out.println("Hello World!");
}
}
- First fore lins are Comments. A long ons starts with /* or /** and ends with */ . A short one starts with // and end with
- Fifth line, Class Title...Object name is case-sensitive,capitalize first letter of each word.
- Sixth line, MAIN method.
- Ninth line, call System.out object and its println() method.
/* The HelloWorld class implements an applet that
displays "Hello World!" within an XHTML document. */
import java.awt.Graphics; import java.applet.Applet;
public class HelloWorld extends Applet
{
public void init() // Initialize the canvas
{
resize(150,10);
}
public void paint(Graphics g) // Display Hello World!
{
g.drawString("Hello World!",50,25);
}
}
- A Java applet produces object code which restricts local user resource access and can be normally be interpreted within the user's browser.
- The JApplet class is used instead of Applet whenever Swing GUI objects are used
- Extend Applet object, and override the methods.
Your browser does not support Java!
- All applets are intended to be viewed from XHTML documents. In XHTML the object or applet element is placed where desired in the body of the document
- Life Cycle of an Applet
- Initialization - init()
- Display - paint()
- Starting - start()
- Stopping - stop()
- Destruction - destory()
- Java Tutorial 1
- JAVA Array Tutorial(1)
- JAVA JDBC Tutorial(1)
- Java tutorial 1
- regex tutorial using java (1)
- Java NIO Tutorial 1- Introduction
- Java Tutorial
- 【JAVA】【NIO】1、Java NIO Tutorial
- Java Excel API Tutorial
- JSTL-java ee5 tutorial
- Java Applet Tutorial
- Download The Java Tutorial
- Java Web Services Tutorial
- Java JDBC Tutorial
- Java RMI Tutorial
- Java Tutorial 2
- Java Tutorial 4 Encapsulation
- java game programming tutorial
- 深入理解C#委托的实质
- 如何使用Windows Live Writer在博客园发布文章
- 使用渲染到纹理例子
- 木马攻防2
- 一个c#模拟时钟的源代码
- Java Tutorial 1
- Eclipse tomcat 配置方法
- Java Tutorial 2
- 分页存储过程
- Java Toturial 3 - Control Flow
- Java Tutorial 4 Encapsulation
- 清除指定数据库中所有表的记录
- 英语生活箴言
- New laptop