Rabu, 19 Disember 2012

CHAPTER 2 : INTRODUCTION TO JAVA

INTRODUCTION

  • Java is the internet programming language
  • Can be used to develop standalone applications
  • Cross-platform,object-oriented,network-based,and multimedia-ready.

CHARACTERISTIC OF JAVA

  1. Simple
  2. Object Oriented
  3. Distributed
  4. Interpreted
  5. Robust
  6. Secure
  7. Architecture neutral
  8. High-performance
  9. Multithreaded
  10. Dynamic

THE BASIC OF JAVA PROGRAM

  1. APPLICATION
  • Standalone programs
Packages,Classes,Methods,and import Statement


Package : A collection of related classes

Classes  : Consists of methods

Method : Designed to accomplish a specific task.


Creating a Java Program

  1. Use any text editor to create or edit a Java source code
  2. Save the file.Use the same class name.For example class name : Count, file name should be Count.java
  3. Compile the program to translate the source code into bytecode.If no syntax errors,compiler will generate file name Count.class
  4. Execute the program.


High-level build process flow



Basic element of a java program include

  1. The main method
  2. Reserved words
  3. Special symbols
  4. Identifiers
  5. Data types
  6. Expressions
  7. Input
  8. Output
  9. Statements

to create a java program,it is important to understand :

  1. Syntax rules
  2. Semantik rules
  3. How to manipulate strings and numbers
  4. How to declare variables and named conctants
  5. How to receive input and display output
  6. Good programming style and form.


       2.  APPLETS

  • Program designed to run on a Web browser
  • is a program written in the Java programming language that can be included in an HTML page.When use a Java technology-enabled browser to view a page tht contain an applet,the applet's code is transferred to system and executed by the browser's Java Virtual Machine (JVM)
  • Created an applet by extending the class JApplet
  • class JApplet is contained in package javax.swing

Applet Methods

  1. i n i t  method :
  • Initializes variables
  • Gets data from user
  • Places various GUI components.
     2.  p a i n t   method :
  • Performs output.

How to Applet Acesses Javascript Method


http://www.bing.com/images/search?q=applet+methods&view=detail&id=23C5C741F432BD0649EC0D4280A5E5F7F057BB98&FORM=IDFRIR


JAVA PLATFORM

  1. Platform is a hardware or software environment to execute a program.
  2. It also can be defined as a combination of operation of operating system and hardware.
  3. The popular platform are Windows 2000,Linux,Solaris,and MacOS
  4. Java platform is different with other platform because it is only a software to execute an application on different hardware platform.
  5. It has 2 components :
  • Java Virtual Machine (Java VM)
  • Java Application Programming Interface (Java API)






















































How to Applet Access Javascript Method

Tiada ulasan:

Catat Ulasan

Related Posts Plugin for WordPress, Blogger...