SlideShare a Scribd company logo
INTRODUCTION To JAVA PROGRAMMING JESS DALE DELA CRUZ CONTACT # 09267099110
 
ORIGINALLY CALLED  OAK
JAMES ARTHUR GOSLING
FOR MORE INFORMATION VISIT HTTP://JAVA.SUN.COM
 
 
 
JAVA TECHNOLOGY SIMPLE Java was designed to make it much easier to write bug free code. Because Java is simple, it is easy to read and write. There aren't a lot of special cases or tricks that will confuse beginners. Java makes to providing bug-free code is automatic memory allocation and de allocation.
JAVA TECHNOLOGY OBJECT- ORIENTED  MORE OF THIS IN CHAPTER 2
JAVA TECHNOLOGY DISTRIBUTED Java has an extensive library of routines for coping easily with TCP/IP protocols like HTTP and FTP. This makes creating network connections much easier than in C or C++. Java applications can open and access objects across the net via URLs with the same ease that programmers are used to when accessing a local file system.
JAVA TECHNOLOGY INTERPRETED Java byte codes are translated on the fly to native machine instructions (interpreted) and not stored anywhere. And since linking is a more incremental and lightweight process, the development process can be much more rapid and exploratory. As a part of the byte code stream, more compile-time information is carried over and available at runtime. This is what the linker's type checks are based on. It also makes programs more amenable to debugging.
JAVA TECHNOLOGY ROBUST robustness is its portability across many Operating systems, with is supported by the Java Virtual Machine.
JAVA TECHNOLOGY SECURE The Java compiler catches more compile-time errors; other languages (like C++) will compile programs that produce unpredictable results. Java does not allocate direct pointers to memory. This makes it impossible to accidentally reference memory that belongs to other programs or the kernel.
JAVA TECHNOLOGY ARCHITECTURAL NEUTRAL Java was designed to support applications on networks. In general, networks are composed of a variety of systems with a variety of CPU and operating system architectures. To enable a Java application to execute anywhere on the network, the compiler generates an architecture-neutral object file format--the compiled code is executable on many processors, given the presence of the Java runtime system.This is useful not only for networks but also for single system software distribution. In the present personal computer market, application writers have to produce versions of their application that are compatible with the IBM PC and with the Apple Macintosh. With the PC market (through Windows/NT) diversifying into many CPU architectures, and Apple moving off the 680x0 toward the PowerPC, production of software that runs on all platforms becomes nearly impossible. With Java, the same version of the application runs on all platforms.
JAVA TECHNOLOGY PORTABLE The Java system itself is quite portable. The compiler is written in Java and the runtime is written in ANSI C with a clean portability boundary.
JAVA TECHNOLOGY HIGH PERFORMANCE While you'll never get that last ounce of speed out of a Java program that you might be able to wring from C or Fortran, the results will be suitable for all but the most demanding applications. It is certainly possible to write large programs in Java. The HotJava browser, the Eclipse integrated development environment, the LimeWire file sharing application, the jEdit text editor, the JBoss application server, the Tomcat servlet container, the Xerces XML parser, the Xalan XSLT processor, and the javac compiler are large programs that are written entirely in Java.
JAVA TECHNOLOGY MULTI THREADING This makes Java very responsive to user input. It also helps to contribute to Java's robustness and provides a mechanism whereby the Java environment can ensure that a malicious applet doesn't steal all of the host's CPU cycles.
JAVA TECHNOLOGY  DYNAMIC In a number of ways, Java is a more dynamic language than C or C++. It was designed to adapt to an evolving environment. For example, one major problem with C++ in a production environment is a side-effect of the way that code is implemented. If company A produces a class library (a library of plug and play components) and company B buys it and uses it in their product, then if A changes its library and distributes a new release, B will almost certainly have to recompile and redistribute their own software. In an environment where the end user gets A and B's software independently (say A is an OS vendor and B is an application vendor) problems can result. For example, if A distributes an upgrade to its libraries, then all of the software from B will break. It is possible to avoid this problem in C++, but it is extraordinarily difficult and it effectively means not using any of the language's OO features directly. By making these interconnections between modules later, Java completely avoids these problems and makes the use of the object-oriented paradigm much more straightforward. Libraries can freely add new methods and instance variables without any effect on their clients.
How to program JAVA With the compiler, first you translate a program into an inter-mediate language called Java bytecodes—the platform-independent codes interpreted by the interpreter on the Java platform. The interpreter parses and runs each Java bytecode instruction on the computer. Compilation happens just once; interpretation occurs each time the program is executed.
 
HOW TO PROGRAM IN JAVA
JAVA PLATFORM A platform is the hardware or software environment in which a program runs. We've already mentioned some of the most popular platforms, such as Windows 2000, Linux, Solaris, and MacOS. Most platforms can be described as a combination of the operating system and hardware. The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other, hardware-based platforms.
The Java platform has two Components: The  Java   V irtual  M achine (Java VM) The Java  A pplication  P rogramming  I nterface (Java API)
Java   V irtual  M achine It's the base for the Java platform and is ported onto various hardware-based platforms.
JAVA  A PPLICATION  P ROGRAMMING  I NTERFACE The  Java API  is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as  packages . The next section highlights what functionality some of the packages in the Java API provide.
Types of programs written in the Java programming language APPLETS An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a page. When you use a Java technology-enabled browser to view a page that contains an applet, the applet's code is transferred to your system and executed by the browser's Java Virtual Machine (JVM). For information and examples on how to include an applet in an HTML page, refer to this description of the  <APPLET>  tag.  APPLICATIONS An application is a standalone program that runs directly on the Java  platform. A special kind of application known as a server serves and  supports clients on a network. Examples of servers are Web servers, mail  servers, and print servers. SERVLETS Java Servlet technology provides Web developers with a simple, consistent mechanism for extending the functionality of a Web server and for accessing existing business systems. A servlet can almost be thought of as an applet that runs on the server side--without a face. Java servlets make many Web applications possible.
NEW  FEATURES  IN JAVA  Development Tools : The development tools provide everything you'll need for compiling, running, monitoring, debugging, and documenting your applications. As a new developer, the main tools you'll be using are the javac compiler, the java launcher, and the javadoc documentation tool.  Application Programming Interface (API) : The API provides the core functionality of the Java programming language. It offers a wide array of useful classes ready for use in your own applications. It spans everything from basic objects, to networking and security, to XML generation and database access, and more. The core API is very large; to get an overview of what it contains, consult the  Java SE Development Kit 6 (JDKTM 6) documentation .  Deployment Technologies : The JDK software provides standard mechanisms such as the Java Web Start software and Java Plug-In software for deploying your applications to end users.  User Interface Toolkits : The Swing and Java 2D toolkits make it possible to create sophisticated Graphical User Interfaces (GUIs).  Integration Libraries : Integration libraries such as the Java IDL API, JDBCTM API, Java Naming and Directory InterfaceTM (&quot;J.N.D.I.&quot;) API, Java RMI, and Java Remote Method Invocation over Internet Inter-ORB Protocol Technology (Java RMI-IIOP Technology) enable database access and manipulation of remote objects.  Java Database Connectivity (JDBC™):  Provides uniform access to a wide range of relational databases.
COMMENTS /* text */ The compiler ignores everything from the opening /* to the closing */. /** documentation */ This style indicates a documentation comment (doc comment, for short). As with the first kind of comment, the compiler ignores all the text within the comment. The SDK javadoc tool uses doc comments to automatically generate documentation.  // text The compiler ignores everything from the // to the end of the line.
CLASS A class is the basic building block of an object-oriented language, such as the Java programming language. A class is a blueprint that describes the state and the behavior associated with instances of that class. When you instantiate a class, you create an object that has the same states and behaviors as other instances of the same class. The state associated with a class or an object is stored in member variables. The behavior associated with a class or an object is implemented with methods, which are similar to the functions or procedures in procedural languages, such as C.  class Mammal { . . . //class definition block }
public static void main(String[] args)   The main method declaration starts with three modifiers: public: Allows any class to call the main method static: Means that the main method is associated with the HelloWorldApp class as a whole instead of operating on an instance of the class void: Indicates that the main method does not return a value
System class The System class provides system-independent access to system-dependent functionality. One feature provided by the System class is the standard output stream—a place to send text that usually refers to the terminal window in which you invoked the Java interpreter.  System.out.println(&quot;Hello World!&quot;);
 
Elements You can write in JAVA  All keywords are written as small letters so  HUWAG NG MAKULIT !!!
Elements You can write in JAVA
 
Elements You can write in JAVA
Elements You can write in JAVA
Elements You can write in JAVA
 
 

More Related Content

PPT
Java basic introduction
Ideal Eyes Business College
 
PPT
Core java concepts
Ram132
 
PDF
JavaScript - Chapter 15 - Debugging Techniques
WebStackAcademy
 
PPTX
Java
Tony Nguyen
 
PDF
Introduction to Java Programming
Ravi Kant Sahu
 
PPTX
Packages in java
Elizabeth alexander
 
PPTX
PROGRAMMING IN JAVA unit 1.pptx
SeethaDinesh
 
Java basic introduction
Ideal Eyes Business College
 
Core java concepts
Ram132
 
JavaScript - Chapter 15 - Debugging Techniques
WebStackAcademy
 
Introduction to Java Programming
Ravi Kant Sahu
 
Packages in java
Elizabeth alexander
 
PROGRAMMING IN JAVA unit 1.pptx
SeethaDinesh
 

What's hot (20)

PPT
Exception Handling in JAVA
SURIT DATTA
 
PPTX
How java differs from c and c++
shalinikarunakaran1
 
PPTX
Java script
Abhishek Kesharwani
 
PPTX
Packages in java
Jerlin Sundari
 
PPTX
Java Programming
Elizabeth alexander
 
PPTX
Classes objects in java
Madishetty Prathibha
 
ODP
Introducción a JQuery
Continuum
 
PPT
Oops concepts in php
CPD INDIA
 
PPT
ABSTRACT CLASSES AND INTERFACES.ppt
JayanthiM15
 
PDF
Core Java
Prakash Dimmita
 
PPTX
Introduction to java
Veerabadra Badra
 
PPSX
Introduction to Java
Hitesh-Java
 
PPT
Java Presentation
pm2214
 
PPT
Jsp ppt
Vikas Jagtap
 
PPTX
Abstract Class Presentation
tigerwarn
 
ODP
Basic of Java
Ajeet Kumar Verma
 
PDF
Jdbc Complete Notes by Java Training Center (Som Sir)
Som Prakash Rai
 
PDF
Java Programming
Anjan Mahanta
 
PPTX
QSpiders - Jdk Jvm Jre and Jit
Qspiders - Software Testing Training Institute
 
PPT
Abstract class
Tony Nguyen
 
Exception Handling in JAVA
SURIT DATTA
 
How java differs from c and c++
shalinikarunakaran1
 
Java script
Abhishek Kesharwani
 
Packages in java
Jerlin Sundari
 
Java Programming
Elizabeth alexander
 
Classes objects in java
Madishetty Prathibha
 
Introducción a JQuery
Continuum
 
Oops concepts in php
CPD INDIA
 
ABSTRACT CLASSES AND INTERFACES.ppt
JayanthiM15
 
Core Java
Prakash Dimmita
 
Introduction to java
Veerabadra Badra
 
Introduction to Java
Hitesh-Java
 
Java Presentation
pm2214
 
Jsp ppt
Vikas Jagtap
 
Abstract Class Presentation
tigerwarn
 
Basic of Java
Ajeet Kumar Verma
 
Jdbc Complete Notes by Java Training Center (Som Sir)
Som Prakash Rai
 
Java Programming
Anjan Mahanta
 
QSpiders - Jdk Jvm Jre and Jit
Qspiders - Software Testing Training Institute
 
Abstract class
Tony Nguyen
 
Ad

Viewers also liked (9)

PPT
Java Basics
Dhanunjai Bandlamudi
 
PDF
Introduction to java technology
Indika Munaweera Kankanamge
 
PPT
Intuit commissions manager
sshhzap
 
PDF
Chapter 1. java programming language overview
Jong Soon Bok
 
PDF
02 basic java programming and operators
Danairat Thanabodithammachari
 
PPS
Java session01
Niit Care
 
PDF
Jena – A Semantic Web Framework for Java
Aleksander Pohl
 
PPT
Object Oriented Programming with Java
Jussi Pohjolainen
 
PDF
Object-Oriented Analysis And Design With Applications Grady Booch
Sorina Chirilă
 
Introduction to java technology
Indika Munaweera Kankanamge
 
Intuit commissions manager
sshhzap
 
Chapter 1. java programming language overview
Jong Soon Bok
 
02 basic java programming and operators
Danairat Thanabodithammachari
 
Java session01
Niit Care
 
Jena – A Semantic Web Framework for Java
Aleksander Pohl
 
Object Oriented Programming with Java
Jussi Pohjolainen
 
Object-Oriented Analysis And Design With Applications Grady Booch
Sorina Chirilă
 
Ad

Similar to Chapter 1 introduction to java technology (20)

DOCX
Software environment
Kinnudj Amee
 
DOCX
Software requirement
madhukarreddy007
 
DOCX
java introduction.docx
vikasbagra9887
 
PPTX
Features of java unit 1
RubaNagarajan
 
PPTX
Java Intro
Nazmul Hasan Rupok
 
PPT
Core Java Slides
Vinit Vyas
 
PPT
Java presentation
Karan Sareen
 
PPT
Java & J2EE Struts with Hibernate Framework
Mohit Belwal
 
PPTX
Unit1 JAVA.pptx
RahulAnand111531
 
PPTX
Java ms harsha
Harsha Batra
 
PPT
J2ee strutswithhibernate-140121221332-phpapp01
Jay Palit
 
PPTX
Java Programming (M&M)
mafffffe19
 
PPTX
JAVA ALL 5 MODULE NOTES.pptx
DrPreethiD1
 
PPT
Core java slides
Abhilash Nair
 
PPT
Java features
Madishetty Prathibha
 
DOCX
Analysis
venkatesh anantha
 
PPTX
Java Lecture 1
Qualys
 
PPTX
Java Programming Tutorials Basic to Advanced 1
JALALUDHEENVK1
 
PPTX
Java part1
Raghu nath
 
PDF
Object Oriented Programming slides that can help students
vincentngong2
 
Software environment
Kinnudj Amee
 
Software requirement
madhukarreddy007
 
java introduction.docx
vikasbagra9887
 
Features of java unit 1
RubaNagarajan
 
Java Intro
Nazmul Hasan Rupok
 
Core Java Slides
Vinit Vyas
 
Java presentation
Karan Sareen
 
Java & J2EE Struts with Hibernate Framework
Mohit Belwal
 
Unit1 JAVA.pptx
RahulAnand111531
 
Java ms harsha
Harsha Batra
 
J2ee strutswithhibernate-140121221332-phpapp01
Jay Palit
 
Java Programming (M&M)
mafffffe19
 
JAVA ALL 5 MODULE NOTES.pptx
DrPreethiD1
 
Core java slides
Abhilash Nair
 
Java features
Madishetty Prathibha
 
Java Lecture 1
Qualys
 
Java Programming Tutorials Basic to Advanced 1
JALALUDHEENVK1
 
Java part1
Raghu nath
 
Object Oriented Programming slides that can help students
vincentngong2
 

More from sshhzap (6)

PPT
Chapter 4 flow control structures and arrays
sshhzap
 
PPT
Chapter 2.2 data structures
sshhzap
 
PPT
Chapter3 basic java data types and declarations
sshhzap
 
PPT
Chapter2 java oop
sshhzap
 
PPT
Exercises for ja se
sshhzap
 
PPT
Chapter 5 declaring classes & oop
sshhzap
 
Chapter 4 flow control structures and arrays
sshhzap
 
Chapter 2.2 data structures
sshhzap
 
Chapter3 basic java data types and declarations
sshhzap
 
Chapter2 java oop
sshhzap
 
Exercises for ja se
sshhzap
 
Chapter 5 declaring classes & oop
sshhzap
 

Recently uploaded (20)

DOCX
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PPTX
Odoo 18 Sales_ Managing Quotation Validity
Celine George
 
PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PPTX
How to Manage Global Discount in Odoo 18 POS
Celine George
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PDF
3.The-Rise-of-the-Marathas.pdfppt/pdf/8th class social science Exploring Soci...
Sandeep Swamy
 
PPTX
ACUTE NASOPHARYNGITIS. pptx
AneetaSharma15
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PDF
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
PDF
Wings of Fire Book by Dr. A.P.J Abdul Kalam Full PDF
hetalvaishnav93
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PPTX
NOI Hackathon - Summer Edition - GreenThumber.pptx
MartinaBurlando1
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPT
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
PDF
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PDF
Exploring-Forces 5.pdf/8th science curiosity/by sandeep swamy notes/ppt
Sandeep Swamy
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
Odoo 18 Sales_ Managing Quotation Validity
Celine George
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 
How to Manage Global Discount in Odoo 18 POS
Celine George
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
3.The-Rise-of-the-Marathas.pdfppt/pdf/8th class social science Exploring Soci...
Sandeep Swamy
 
ACUTE NASOPHARYNGITIS. pptx
AneetaSharma15
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
Wings of Fire Book by Dr. A.P.J Abdul Kalam Full PDF
hetalvaishnav93
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
NOI Hackathon - Summer Edition - GreenThumber.pptx
MartinaBurlando1
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Exploring-Forces 5.pdf/8th science curiosity/by sandeep swamy notes/ppt
Sandeep Swamy
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 

Chapter 1 introduction to java technology

  • 1. INTRODUCTION To JAVA PROGRAMMING JESS DALE DELA CRUZ CONTACT # 09267099110
  • 2.  
  • 5. FOR MORE INFORMATION VISIT HTTP://JAVA.SUN.COM
  • 6.  
  • 7.  
  • 8.  
  • 9. JAVA TECHNOLOGY SIMPLE Java was designed to make it much easier to write bug free code. Because Java is simple, it is easy to read and write. There aren't a lot of special cases or tricks that will confuse beginners. Java makes to providing bug-free code is automatic memory allocation and de allocation.
  • 10. JAVA TECHNOLOGY OBJECT- ORIENTED MORE OF THIS IN CHAPTER 2
  • 11. JAVA TECHNOLOGY DISTRIBUTED Java has an extensive library of routines for coping easily with TCP/IP protocols like HTTP and FTP. This makes creating network connections much easier than in C or C++. Java applications can open and access objects across the net via URLs with the same ease that programmers are used to when accessing a local file system.
  • 12. JAVA TECHNOLOGY INTERPRETED Java byte codes are translated on the fly to native machine instructions (interpreted) and not stored anywhere. And since linking is a more incremental and lightweight process, the development process can be much more rapid and exploratory. As a part of the byte code stream, more compile-time information is carried over and available at runtime. This is what the linker's type checks are based on. It also makes programs more amenable to debugging.
  • 13. JAVA TECHNOLOGY ROBUST robustness is its portability across many Operating systems, with is supported by the Java Virtual Machine.
  • 14. JAVA TECHNOLOGY SECURE The Java compiler catches more compile-time errors; other languages (like C++) will compile programs that produce unpredictable results. Java does not allocate direct pointers to memory. This makes it impossible to accidentally reference memory that belongs to other programs or the kernel.
  • 15. JAVA TECHNOLOGY ARCHITECTURAL NEUTRAL Java was designed to support applications on networks. In general, networks are composed of a variety of systems with a variety of CPU and operating system architectures. To enable a Java application to execute anywhere on the network, the compiler generates an architecture-neutral object file format--the compiled code is executable on many processors, given the presence of the Java runtime system.This is useful not only for networks but also for single system software distribution. In the present personal computer market, application writers have to produce versions of their application that are compatible with the IBM PC and with the Apple Macintosh. With the PC market (through Windows/NT) diversifying into many CPU architectures, and Apple moving off the 680x0 toward the PowerPC, production of software that runs on all platforms becomes nearly impossible. With Java, the same version of the application runs on all platforms.
  • 16. JAVA TECHNOLOGY PORTABLE The Java system itself is quite portable. The compiler is written in Java and the runtime is written in ANSI C with a clean portability boundary.
  • 17. JAVA TECHNOLOGY HIGH PERFORMANCE While you'll never get that last ounce of speed out of a Java program that you might be able to wring from C or Fortran, the results will be suitable for all but the most demanding applications. It is certainly possible to write large programs in Java. The HotJava browser, the Eclipse integrated development environment, the LimeWire file sharing application, the jEdit text editor, the JBoss application server, the Tomcat servlet container, the Xerces XML parser, the Xalan XSLT processor, and the javac compiler are large programs that are written entirely in Java.
  • 18. JAVA TECHNOLOGY MULTI THREADING This makes Java very responsive to user input. It also helps to contribute to Java's robustness and provides a mechanism whereby the Java environment can ensure that a malicious applet doesn't steal all of the host's CPU cycles.
  • 19. JAVA TECHNOLOGY DYNAMIC In a number of ways, Java is a more dynamic language than C or C++. It was designed to adapt to an evolving environment. For example, one major problem with C++ in a production environment is a side-effect of the way that code is implemented. If company A produces a class library (a library of plug and play components) and company B buys it and uses it in their product, then if A changes its library and distributes a new release, B will almost certainly have to recompile and redistribute their own software. In an environment where the end user gets A and B's software independently (say A is an OS vendor and B is an application vendor) problems can result. For example, if A distributes an upgrade to its libraries, then all of the software from B will break. It is possible to avoid this problem in C++, but it is extraordinarily difficult and it effectively means not using any of the language's OO features directly. By making these interconnections between modules later, Java completely avoids these problems and makes the use of the object-oriented paradigm much more straightforward. Libraries can freely add new methods and instance variables without any effect on their clients.
  • 20. How to program JAVA With the compiler, first you translate a program into an inter-mediate language called Java bytecodes—the platform-independent codes interpreted by the interpreter on the Java platform. The interpreter parses and runs each Java bytecode instruction on the computer. Compilation happens just once; interpretation occurs each time the program is executed.
  • 21.  
  • 22. HOW TO PROGRAM IN JAVA
  • 23. JAVA PLATFORM A platform is the hardware or software environment in which a program runs. We've already mentioned some of the most popular platforms, such as Windows 2000, Linux, Solaris, and MacOS. Most platforms can be described as a combination of the operating system and hardware. The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other, hardware-based platforms.
  • 24. The Java platform has two Components: The Java V irtual M achine (Java VM) The Java A pplication P rogramming I nterface (Java API)
  • 25. Java V irtual M achine It's the base for the Java platform and is ported onto various hardware-based platforms.
  • 26. JAVA A PPLICATION P ROGRAMMING I NTERFACE The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as packages . The next section highlights what functionality some of the packages in the Java API provide.
  • 27. Types of programs written in the Java programming language APPLETS An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a page. When you use a Java technology-enabled browser to view a page that contains an applet, the applet's code is transferred to your system and executed by the browser's Java Virtual Machine (JVM). For information and examples on how to include an applet in an HTML page, refer to this description of the  <APPLET>  tag. APPLICATIONS An application is a standalone program that runs directly on the Java platform. A special kind of application known as a server serves and supports clients on a network. Examples of servers are Web servers, mail servers, and print servers. SERVLETS Java Servlet technology provides Web developers with a simple, consistent mechanism for extending the functionality of a Web server and for accessing existing business systems. A servlet can almost be thought of as an applet that runs on the server side--without a face. Java servlets make many Web applications possible.
  • 28. NEW FEATURES IN JAVA Development Tools : The development tools provide everything you'll need for compiling, running, monitoring, debugging, and documenting your applications. As a new developer, the main tools you'll be using are the javac compiler, the java launcher, and the javadoc documentation tool. Application Programming Interface (API) : The API provides the core functionality of the Java programming language. It offers a wide array of useful classes ready for use in your own applications. It spans everything from basic objects, to networking and security, to XML generation and database access, and more. The core API is very large; to get an overview of what it contains, consult the Java SE Development Kit 6 (JDKTM 6) documentation . Deployment Technologies : The JDK software provides standard mechanisms such as the Java Web Start software and Java Plug-In software for deploying your applications to end users. User Interface Toolkits : The Swing and Java 2D toolkits make it possible to create sophisticated Graphical User Interfaces (GUIs). Integration Libraries : Integration libraries such as the Java IDL API, JDBCTM API, Java Naming and Directory InterfaceTM (&quot;J.N.D.I.&quot;) API, Java RMI, and Java Remote Method Invocation over Internet Inter-ORB Protocol Technology (Java RMI-IIOP Technology) enable database access and manipulation of remote objects. Java Database Connectivity (JDBC™): Provides uniform access to a wide range of relational databases.
  • 29. COMMENTS /* text */ The compiler ignores everything from the opening /* to the closing */. /** documentation */ This style indicates a documentation comment (doc comment, for short). As with the first kind of comment, the compiler ignores all the text within the comment. The SDK javadoc tool uses doc comments to automatically generate documentation. // text The compiler ignores everything from the // to the end of the line.
  • 30. CLASS A class is the basic building block of an object-oriented language, such as the Java programming language. A class is a blueprint that describes the state and the behavior associated with instances of that class. When you instantiate a class, you create an object that has the same states and behaviors as other instances of the same class. The state associated with a class or an object is stored in member variables. The behavior associated with a class or an object is implemented with methods, which are similar to the functions or procedures in procedural languages, such as C. class Mammal { . . . //class definition block }
  • 31. public static void main(String[] args) The main method declaration starts with three modifiers: public: Allows any class to call the main method static: Means that the main method is associated with the HelloWorldApp class as a whole instead of operating on an instance of the class void: Indicates that the main method does not return a value
  • 32. System class The System class provides system-independent access to system-dependent functionality. One feature provided by the System class is the standard output stream—a place to send text that usually refers to the terminal window in which you invoked the Java interpreter. System.out.println(&quot;Hello World!&quot;);
  • 33.  
  • 34. Elements You can write in JAVA All keywords are written as small letters so HUWAG NG MAKULIT !!!
  • 35. Elements You can write in JAVA
  • 36.  
  • 37. Elements You can write in JAVA
  • 38. Elements You can write in JAVA
  • 39. Elements You can write in JAVA
  • 40.  
  • 41.