Features of JAVA PLATFORM INDEPENDENT LANGUAGE JAVA RUNTIME ENVIRONMENT (JRE) JAVA VIRTUAL MACHINE (JVM) JAVA APP BYTE CODE JAVA RUNTIME ENVIRONMENT.

Slides:



Advertisements
Similar presentations
Core Java Lecture 4-5. What We Will Cover Today What Are Methods Scope and Life Time of Variables Command Line Arguments Use of static keyword in Java.
Advertisements

1 pritisajja.info Unlocking the World of Java Programming….. Priti Srinivas Sajja February, 2014 Visit pritisajja.info for detail Future Technology for.
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
Terms and Rules Professor Evan Korth New York University (All rights reserved)
Introduction to Java Programming Language Junji Zhi University of Toronto 1.
C++ fundamentals.
A Short Introduction to JAVA
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
CMSC 341 Introduction to Java Based on tutorial by Rebecca Hasti at
Programming in Java; Instructor:Moorthy Introduction, Objects, Classes, Libraries1 Programming in Java Introduction.
Java Programming CIS 421 Web-Based Java Programming.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
DAT602 Database Application Development Lecture 5 JAVA Review.
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
Java Programming A Brief Intro. Overview of Java  Java Features  How Java Works  Program-Driven vs Event Driven  Graphical User Interfaces (GUI)
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
Java Programming Presented by Daniel Rosenthal Friday, November 30 th, 2007.
Introduction to java Prepared By:-Pragnesh Patel Lect. In Computer Dept. NSIT,Jetalpur 1.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
 JAVA Compilation and Interpretation  JAVA Platform Independence  Building First JAVA Program  Escapes Sequences  Display text with printf  Data.
Applied Computing Technology Laboratory QuickStart C# Learning to Program in C# Amy Roberge & John Linehan November 7, 2005.
1 Introduction to Java. 2 What is Java? A programming language. A platform –A virtual machine (JVM) definition. –Runtime environments in diverse hardware.
Fall 2015CISC124 - Prof. McLeod1 CISC124 Have you filled out the lab section survey? (As of last night 54 left to fill out the survey.) TA names have been.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and web applications Very rich GUI libraries Portability (machine independence) A real Object.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Overview of Java CSCI 392 Day One. Running C code vs Java code C Source Code C Compiler Object File (machine code) Library Files Linker Executable File.
1 The JAVA Language Object Oriented Technology Mithani Binjan M.
Developed at Sun Microsystems in 1991 James Gosling, initially named “OAK” Formally announced java in 1995 Object oriented and cant write procedural.
introductory lecture on java programming
Classes, Interfaces and Packages
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Java Computer Industry Lab. 1 Programming Java Java Basics Incheon Paik.
OOP Basics Classes & Methods (c) IDMS/SQL News
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Object Oriented Programming Lecture 2: BallWorld.
Seventh step for Learning C++ Programming CLASS Declaration Public & Private Constructor & Destructor This pointer Inheritance.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Introduction to java (class and object). Programming languages: –Easier to understand than CPU instructions –Needs to be translated for the CPU to understand.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Modern Programming Tools And Techniques-I
JAVA MULTIPLE CHOICE QUESTION.
Intro to ETEC Java.
Chapter No. : 1 Introduction to Java.
Yanal Alahmad Java Workshop Yanal Alahmad
Internet and Java Foundations, Programming and Practice
Java Review Hello..This ppt is to give you an introduction about java and why it is soo special The segments all discussed here are the crucial parts of.
Programming Language Concepts (CIS 635)
Introduction to Java Originally developed by James Gosling at Sun Microsystems In 1991 named “OAK” In 1995, this language was renamed as “Java”. (which.
An Introduction to Java – Part I, language basics
Java Intro.
Units with – James tedder
Units with – James tedder
C++ Programming ㅎㅎ String OOP Class Constructor & Destructor.
Session 2: Introduction to Object Oriented Programming
(Computer fundamental Lab)
OBJECT ORIENTED PROGRAMMING
Object Oriented Programming in java
OBJECT ORIENTED PROGRAMMING
Chap 1. Getting Started Objectives
Introduction to java Part I By Shenglan Zhang.
Presentation transcript:

Features of JAVA

PLATFORM INDEPENDENT LANGUAGE JAVA RUNTIME ENVIRONMENT (JRE) JAVA VIRTUAL MACHINE (JVM) JAVA APP BYTE CODE JAVA RUNTIME ENVIRONMENT (JRE) JAVA VIRTUAL MACHINE (JVM) javacjava javac JAVA APP BYTE CODE java.java.class OPERATING SYSTEM 2 OPERATING SYSTEM 1

OBJECT ORIENTED PROGRAMMING – ENCAPSULATION –INHERITANCE –Simple Inheritance –Multi Level Inheritance –Multiple Inheritance –ABSTRACTION / POLIMORPHISM

SECURED –DATA ENCAPSULATION –NO POINTERS –NO UNAUTHORISED CODE ROBUST IN MEMORY MANAGEMENT MULTI THREADING PROGRAMMING GUI PROGRAMMING WEB BASED (APPLETS) HANDLING RUNTIME ERRORS NETWORK BASED APPLICATIONS

JAVA EDITIONS JAVA J2SEJ2EEJ2ME

Object Oriented Programming

Simple Programme in JAVA import java.lang.*; public class Hello { public static void main(String args[]) { System.out.println(“Hello, Friend”); }

Set the path and classpath PATH=%PATH%;c:\j2sdk1.4.0\bin CLASSPATH=c:\j2sdk1.4.0\lib\tools.jar Save Hello.java Compile prompt:\> javac Hello.java Execute prompt:\> java Hello Output Hello, Friend How To Excecute a Programme

CLASS Class is blue print or an idea of an Object From One class any number of Instances can be created It is an encapsulation of attributes and methods FIGURE CIRCLE RECTANGLE SQUARE Ob1 Ob2 Ob3 class

syntax of CLASS class { attributes/variables; Constructors(); methods(); }

INSTANCE Instance is an Object of a class which is an entity with its own attribute values and methods. Creating an Instance ClassName refVariable; refVariable = new Constructor(); or ClassName refVariable = new Constructor();

VARIABLE It is a reference to a value in the memory. These are two types.. 1.Instance Variables Ex.: int a=5; boolean b=false; 2.Reference Variables Ex.:Circle c=new Circle(); Student stud=new Student();

Data Types TypeMemoryInitials Value byte1 byte0 short2 bytes0 int4 bytes0 long8 bytes0 float4 bytes0.0 double8 bytes0.0 char2 bytesnil booleantrue / falsefalse

Declaration of Variables = ; Example: byte a = 5; short b = 100; int n = 5000; long l = 10000; float f = 5.5 f; double d = 10.5; double d=10.5d; char c = ‘a’; boolean b = true;

CONSTRUCTOR

It is used to create an instance and initialise the variable values in an instance. Is a special type of method with class name and without return type. A constructor without arguments is Default Constructor. syntax: ClassName(arguments) { variable initialisation; }

class Calculator { int a, b; Calculator(int a, int b) { this.a=a; this.b=b; } Example of Constructor

‘this’ keyword ‘this’ is a keyword used to refer to hidden instance variables of present class. this.a=a; It is used to call a constructor from another constructor in overloaded constructors in a class which should be first statement. this(a,b); It is used to call a method from another method in overloaded methods to avoid redundancy of code in methods this.addNumbers(a, b);

OVERLOADED CONSTRUCTORS Having more than one constructor in single class by changing the arguments either with data types or in no. of arguments Calculator() { this(0,0) } Calculator(int a, int b) { this.a=a; this.b=b; }

METHOD

Is a function / behavior used to access the attributes / variables of the class. syntax: return_type methodName(arguments) { ………….. statements …………. return value; } METHOD

int addNumbers(int a, int b) { int c = a + b; return c; } Example of method

Having more than one method with same name in a single class by changing in either in no. of arguments or in data types of arguments. Example: double divideNumbers(int a, int b) double divideNumbers(double a, double b) double divideNumbers(int a, int b, int c) OVERLOADED METHODS