12. รูปแบบของ Class class declaration { variable constructor method nested class or inner class } class a { int a = 0; a() { } void b () { } class c { } }
13. ชื่อเรียกเกี่ยวกับ Object Object Model State Behavior Identity General, UML Value of Attribute Behavior/Action Attribute OOP Value of Variable Method Property Coding in Java Value of Attribute Method Variable/Attr.
14. เขียนโปรแกรมแรก start, run, cmd cddir cd c:2sdk1.4.2_03in c:2sdk1.4.2_03in>edit x.java class x { public static void main(String args[]){ System.out.println("hello"); } }
16. คำที่ขีดเส้นใต้ เปลี่ยนได้ตามต้องการ class xxx { public static void main (String args []){ System.out.println(" hello "); } } class aaa { void bbb (String[] ccc ){ System.out.println(" ddd "); System.out.println( eee (" ddd ")); } int eee (String fff ){ return (" xxx "); } }
17. Java Applet //<applet code=x.class width=200 height=200></applet> //DOS>appletviewer x.java import java.awt.Graphics; public class x extends java.applet.applet { public void paint(Graphics g) { g.drawString("test",10,20); } }
18. Java Application // javac y.java // java y import java.lang.*; import java.awt.*; import java.awt.event.*; public class y implements ActionListener{ Frame fs = new Frame("header"); Button bexit = new Button("exit"); public static void main(String args[]) { y s = new y(); s.init(); } public void init() { fs.setSize(200,100); fs.setLayout(null); bexit.setBounds(10,50,50,20); fs.add(bexit); bexit.addActionListener(this); fs.show(); } public void actionPerformed(ActionEvent a) { System.exit(0); } }
19. Certified Topics Product ID CX-310-035 Price $200.00 The Sun Certified Programmer for Java 2 Platform 1.4 certification exam is for programmers experienced in using the basic syntax and structure of the Java programming language. Certification is available for the Java 2 Platform. http://www.sun.com/training/catalog/courses/CX-310-035.xml