Java peresentation new soft

Post on 15-Jan-2015

149 views 2 download

Tags:

description

Simple introduction to java programming

Transcript of Java peresentation new soft

JAVA Programming LanguageMohamed Refaat

Historical View Sun formally announced Java at an

industry conference in May 1995. Java is now used to develop large-scale

enterprise applications.

Java Class Libraries Java programs consist of pieces called

classes. Classes include pieces called methods

and Object that perform tasks.

JAVA Characteristic Object-oriented. Portable - platform independent.

Simpler development - strong and static typing.

Familiar - took the best out of C++.

JVM – Java Virtual Machine JVM is an interpreter that translates Java

bytecode into real machine language instructions.

Compiled once run on any machine that has a JVM.

JVM – Java Virtual Machine Java SDK (Software Development

Kit). JRE (Java Runtime Environment). JDK (Java Development Kit).

JVM – Java Virtual Machine

IDE – Integrated Development Environment Oracle JDeveloper.

Eclipse.

NetBeans.

And More…

How To Work… Download Java JDK from this Link. Install JDK. Use one of the Previous editor (IED) for

develop.

Hello World…package HelloWorld;public class HelloWorld {public HelloWorld() {}// Constructorpublic HelloWorld(String s){

System.out.println(s);}public static void main(String[] args) {

// TODO Auto-generated method stubSystem.out.println("I'm JAVA Programmer...");

}}

Main Method Like C ,C++ and C#, Java applications

must define a main() method in order to be run.

Primitive Types

Flow Control

For each For each input [i] in iterator a do

int [] a = new int[10];for(int i : a){

System.out.println(i);}

Using Packagesimport HelloWorld.*;…

HelloWorld hw=new HelloWorld();

Visibility of Members public

Can be accessed from outside the package. protected

Can be accessed from derived classes private

Can be accessed only from the current class default ( if no access modifier is stated )

Can be called within the same package.

The Object Class Root of the class hierarchy. Any Class extends Object Class. boolean equals(Object o) // check equality String toString() // called when print the class out Put Class

name

EX: System.out.println(hw); Has many other uses class

EX: Math,

Equality Test EX: String ExampleHelloWorld hw1 = new HelloWorld ();HelloWorld hw2 = new HelloWorld ();if (hw1 == hw2){System.out.println("hw1 == hw2");}

Generic Define generic object.

Can use the same object with deferent type.

ArrayList<String> arrList = new ArrayList<String>();ArrayList<Integer> arrList = new ArrayList<Integer>();

Collections Set :

A collection that does not contain duplicates. List :

An ordered collection that can contain duplicate elements. ArrayList.

Map : Associates keys to values and cannot contain duplicate keys.

Queue :

Resources JAVA Tutorial

http://docs.oracle.com/javase/tutorial/

JAVA Documentation http://docs.oracle.com/javase/6/docs/api/

JAVA Book Java How to Program 7th Edition (2007)

You can find this presentation and SMS Project on this link https://docs.google.com/open?id=0BwXvifbsCL2iSmst

REd1UHZ3N3M

Thanks …