Core Java Programming
57 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris

Core Java Programming , livre ebook

-

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris
Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus
57 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus

Description

Core Java Programming : This book is specially written for beginner Java Students and Programmers to gain fundamentals knowledge about Java programming using easy to use practice examples. This book contains a track for those who are afraid of Java Programming and are confused about how to start Java? Which way to start?

Also every one with interest in Java Programming can refer this book to get the knowledge about Various features the subject.

It covers virtually most of Java and JVM features and some of the advanced features like AWT, Swing, Multithreading, Applets etc... including more than hands on examples tested. Samples are presented in easy to use way through Java Language.

Sujets

Informations

Publié par
Date de parution 10 mars 2013
Nombre de lectures 14
EAN13 9781456613846
Langue English

Informations légales : prix de location à la page 0,0250€. Cette information est donnée uniquement à titre indicatif conformément à la législation en vigueur.

Extrait

Core Java Programming
By Jitendra Patel

Overview
Core Java Programming : This book is specially written for beginner Java Students and Programmers to gain fundamentals knowledge about Java programming using easy to use practice examples. This book contains a track for those who are afraid of Java Programming and are confused about how to start Java? Which way to start?
Also every one with interest in Java Programming can refer this book to get the knowledge about Various features the subject.
It covers virtually most of Java and JVM features and some of the advanced features like AWT, Swing, Multithreading, Applets etc... including more than hands on examples tested. Samples are presented in easy to use way through Java Language.
Copyright © 2012 Jitendra Patel
Core Java Programming
No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an "as is" basis. The authors and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.
Chapter 1 Introduction to JAVA
Java has now emerged as the language of choice due to three reasons. Simplicity, portability and security. Java is true object oriented language. Java’s motto is “write once, run anywhere”.

Many software vendors provide tools for Java (visual development tools or also known as integrated development environment IDE). These tools commonly provide a class browser, a source code editor, and a compiler. Some of the popular Java development tools available as listed below.
TOOL
VENDOR
PLATFORM
Java Workshop
Sun Microsystems
Solaris, 95, NT
Java Studio
Sun Microsystems
All Java platforms
Java Plan
Lighthouse Design Limited
Solaris, NT
Visual Café for Java
Symantec
95, 98, NT
Visual J++
Microsoft
95, 98, NT
Visual age for Java
IBM
95, 98, NT, OS2
Jbuilder
Borland
95, 98, NT
SuperCede
SuperCede
95, 98, NT
JdesignerPro
Bullet Proof
95, 98, NT, UNIX
Super Majo
Penumbra s/w
All java platform

Java’s designer have borrowed the best features of many existing language (like C and C++) and added a few new features to form a simple, easy to learn and object oriented language. It is also a secure language, making it well suited for Internet programming.
Java has two lives, one as a stand-alone computer language for general purpose programming (known as applications ) and other as a supporting language for Internet programming (known as applets ).
Object Oriented Programming Approach
Object Oriented Paradigm:
OOP treats data as critical element in the program development and does not allow it to flow freely around the system. It ties the data more closely to the functions that operate on it and protects it from unintentional modifications by other functions. OOP allows us to decompose a problem into a number of entities called Objects and then build data and functions (known as methods in Java) around these entities. The combination of data and objects make up an object.

Some of the features of OO Paradigm are:
=> Emphasis is on data rather than procedure. =>Programs are divided into what are known as Objects . => Data structures are designed such that they characterize the objects. =>Methods that operate on the data are tied together in the data structure. => Data is hidden and can not be accessed by external functions. => Objects may communicate with each other through methods. => New data and methods can be easily added whenever necessary. => Follows bottom-up approach in program design.

Definition of OOP : OOP is an approach that provides way of modularizing programs by creating partitioned memory area for both data and functions that can be used as templates for creating copies of such modules on demand.

Basic concepts of OOP:
=> Objects and classes => Data abstraction and encapsulation => Inheritance => Polymorphism => Dynamic Binding => Message communication.

Advantages of OOP:
ð Through inheritance, we can eliminate redundant code and extend the use of existing classes.
ð The principle of data hiding helps the programmer to build secure programs that can not be attacked by code in other parts of the program.
ð It is possible to have multiple objects to coexist without interference.
ð It is possible to map object in problem domain to those objects in the programs.
ð The data centered approach enable us to capture more details of a model in an implementable form.
ð Object oriented systems can be easily upgraded from small to large systems.
ð Message passing techniques for communicating between objects make the interface descriptions with external systems much simpler.
ð Software complexity can be easily managed.

Applications of OOP:
ð Read time systems
ð Simulation and modelling
ð Object oriented database
ð Hypertext, hypermedia and expertext
ð AI and expert systems
ð Neural networks and parallel programming.
ð Decision support and office automation systems
ð CAD/CAM systems

Java Features
1. Compiled and interpreted
A two stage system. First, Java compiler translates source code into bytecode . Bytecodes are not machine instuctions and therefore, in second stage, Java intepreter generated machine code that can be direclty executed by the machine that is running the Java program.

2. Platform independent and portable
The most significant and important difference between Java and other languages is its portability. Java programs can be easily move from one computer system to other. Changes and upgrades in OS, processor and system resources will not force any change in Java program. This is the reason why Java has become a popular language for programming on Internet, which interconnects different kinds of systems worldwide. We can download a Java applet from a remote computer onto our local system via Internet and execute it locally.
Java ensures portability in two ways. First, Java compiler generates bytecode instructions that can be implemented on any machine. Secondly, the size of primitive data types are machine-independent.

3. Object-oriented
Almost everything in Java is an Object. All program code and data reside within the objects and classes. Java comes with extensive set of classes, arranged in packages, that we can use in our program by inheritance.

4. Robust and secure
It provides many safeguards to ensure reliable code. It has strict compile time and run time checking of data. Java incorporates concept of exception handling which captures series errors and eliminates any risk of crashing system. For programming on Internet security is major issue. Java systems not only verify all memory access but also ensures that no viruses are communicated with an applets. The absence of pointer in Java ensures that programs can not gain access to memory location without prior authorization.

5. Distributed
Java is designed as distributed language for creating applications on networks. It has the ability to share both data and programs. Java applications can open and access remote objects on Internet as easily as they can do with local systems. This enables multiple programmers at multiple remote locations to collaborate and work together on a single project.

6. Familiar, simple and small
Java is a small and simple language. Many features of C and C++ are either redundant or sources of unreliable code are not part of Java. For example, Java does not use pointers, preprocessor header files, goto statement and many others. It also eliminates operator overloading and multiple inheritance.
Java uses many constructs of C and C++ and therefore, Java code “looks like a C++” code. In fact Java is simplified version of C++.

7. Multithreaded and interactive
Multithreaded means handling simple task simultaneously. Java supports multithreaded programs. This means we need not wait for the application to finish one task before beginning other. For example, we can listen an audio clip while scrolling a page and at the same time download an applet from a distant computer. This feature greatly improves the interactive performance of graphical applications.

8. High performance
Java performance is impressive for an interpreted language, mainly due to the use of intermediate bytecode. Java architecture is also designed to reduce overheads during runtime. Furthermore, the incorporation of multithreading enhances the overall execution speed of Java programs.

9. Dynamic and extensible
Java is capable of dynamically linking in new class libraries, methods and objects. Java can also determine the type of class through a query, making it possible to either dynamically link or abort the program, depending on the response.
Java program supports functions written in other languages such as C and C++. These functions are called native methods . Native methods are linked dynamically at runtime.
Java and C
Java and C
Java does not supports
ð goto , sizeof , typedef , struct , union , enum , auto , extern , register , signed and unsigned , explicit pointer
ð #define, #include, #ifdef
ð any mechanism for defining variable arguments to functions
ð void keyword with main
Java adds
ð new operators such as inst

  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents