Chapter 1 introduction to java technology
Upcoming SlideShare
Loading in...5
×
 

Chapter 1 introduction to java technology

on

  • 2,285 views

 

Statistics

Views

Total Views
2,285
Views on SlideShare
2,285
Embed Views
0

Actions

Likes
0
Downloads
104
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Chapter 1 introduction to java technology Chapter 1 introduction to java technology Presentation Transcript

  • 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
  •  
  •