Internet and Java Foundations, Programming and Practice

Slides:



Advertisements
Similar presentations
Basic Java Constructs and Data Types – Nuts and Bolts
Advertisements

Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Lab#1 (14/3/1431h) Introduction To java programming cs425
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
Object Orientated Programming
Shlomo Hershkop1 Introduction to java Class 1 Fall 2003 Shlomo Hershkop.
Introduction to Java Programming
Principles of Object-Oriented Software Development The language Java.
Outline Java program structure Basic program elements
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.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
Java PAL.  Contains the development kit and the runtime environment ( aka the Java Virtual Machine )  Download Link:
CMSC 341 Introduction to Java Based on tutorial by Rebecca Hasti at
Java Software Solutions Lewis and Loftus Chapter 2 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Software Concepts -- Introduction.
Programming in Java; Instructor:Moorthy Introduction, Objects, Classes, Libraries1 Programming in Java Introduction.
Principles of Computer Programming (using Java) Review Haidong Xue Summer 2011, at GSU.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 3 The Structure and Syntax of Java.
1 October 1, October 1, 2015October 1, 2015October 1, 2015 Azusa, CA Sheldon X. Liang Ph. D. Computer Science at Azusa Pacific University Azusa.
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
INTRODUCTION TO JAVA CHAPTER 1 1. WHAT IS JAVA ? Java is a programming language and computing platform first released by Sun Microsystems in The.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
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.
CS591x A very brief introduction to Java. Java Developed by Sun Microsystems was intended a language for embedded applications became a general purpose.
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.
JAVA BASICS Prepared by The Smartpath Information Systems
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.
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 Basic Java Constructs and Data Types – Nuts and Bolts Looking into Specific Differences and Enhancements in Java compared to C.
1 The JAVA Language Object Oriented Technology Mithani Binjan M.
Chapter 8 Class Inheritance and Interfaces F Superclasses and Subclasses  Keywords: super F Overriding methods  The Object Class  Modifiers: protected,
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Developed at Sun Microsystems in 1991 James Gosling, initially named “OAK” Formally announced java in 1995 Object oriented and cant write procedural.
Getting Started With Java September 22, Java Bytecode  Bytecode : is a highly optimized set of instructions designed to be executed by the Java.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Java Computer Industry Lab. 1 Programming Java Java Basics Incheon Paik.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
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.
RealTimeSystems Lab Jong-Koo, Lim
Features of JAVA PLATFORM INDEPENDENT LANGUAGE JAVA RUNTIME ENVIRONMENT (JRE) JAVA VIRTUAL MACHINE (JVM) JAVA APP BYTE CODE JAVA RUNTIME ENVIRONMENT.
JAVA ACCESS MODIFIERS. Access Modifiers Access modifiers control which classes may use a feature. A classes features are: - The class itself - Its member.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
CS-140 Dick Steflik Lecture 3. Java C++ Interpreted optimized for the internet Runs on virtual ized machine Derived from C++ Good object model Widely.
Object Oriented Programming in
Objects as a programming concept
JAVA MULTIPLE CHOICE QUESTION.
Chapter No. : 1 Introduction to Java.
Java package classes Java package classes.
Programming Language Concepts (CIS 635)
Getting Started ARCS Lab..
Introduction to Programming in Java
Unit 41 – Programing in Java
CS-0401 INTERMEDIATE PROGRAMMING USING JAVA
The Building Blocks Classes: Java class library, over 1,800 classes:
Introduction CSC 111.
Units with – James tedder
Units with – James tedder
From C++ to Java Java history: Oak, toaster-ovens, internet language, panacea What it is O-O language, not a hybrid (cf. C++) compiled to byte-code, executed.
(Computer fundamental Lab)
Chap 1. Getting Started Objectives
Chap 4. Programming Fundamentals
Computer Programming-1 CSC 111
Review of Java Fundamentals
Presentation transcript:

Internet and Java Foundations, Programming and Practice Rajkumar Buyya School of Computer Science and Software Engineering Monash University Melbourne, Australia Email: rajkumar@dgs.monash.edu.au URL: http://www.dgs.monash.edu.au/~rajkumar

Java and Java Computing

Java as Portable Unlike other language compilers, Java complier generates code (byte codes) for Universal Machine. Java Virtual Machine (JVM): Interprets bytecodes at runtime Architecture Neutral No Link Phase Higher Level Portable Features: AWT, Unicode

Total Platform Independence JAVA COMPILER (translator) JAVA BYTE CODE (same for all platforms) JAVA INTERPRETER (one for each different system) Windows 95 Macintosh Solaris Windows NT 1

Write Once, Run Anywhere Java Write Once, Run Anywhere

Architecture Neutral & Portable Java Compiler -Java source code to bytecode Bytecode - an intermediate form, closer to machine representation A virtual machine on any target platform interprets the bytecode Porting the java system to any new platform involves writing an interpreter that supports the Java Virtual Machine The interpreter will figure out what the equivalent machine dependent code to run

Basic Data Types Types boolean either true of false char 16 bit Unicode 1.1 byte 8-bit integer (signed) short 16-bit integer (signed) int 32-bit integer (signed) long 64-bit integer (singed) float 32-bit floating point (IEEE 754-1985) double 64-bit floating point (IEEE 754-1985) String (class for manipulating strings) Java uses Unicode to represent characters internally

Power of Compiled Languages Flexibility of Interpreted Languages Java Integrates Power of Compiled Languages and Flexibility of Interpreted Languages

Compile-time Environment Java Environment/ Life Cycle of Java Code Runtime Environment Compile-time Environment Class Loader Bytecode Verifier Java Class Libraries Java Source (.java) Java Interpreter Just in Time Compiler Java Bytecodes move locally or through network Java Virtual machine Java Compiler Runtime System Java Bytecode (.class ) Operating System Hardware

Hello Internet // hello.java: Hello Internet program class HelloInternet { public static void main(String args[]) System.out.println(“Hello Internet”); }

Program Processing Compilation # javac hello.java results in HelloInternet.class Execution # java HelloInternet Hello Internet #

Unit I--Java Constructs what is Java, basic constructs, including classes and objects constructors, this and super keywords, inheritance, abstract classes, interfaces, inner classes, exceptions.

Classes and objects class MyClass { member variables; … declaring a class class MyClass { member variables; … member functions () ; } // end class MyClass

The first Java Application class MyApp { public static void main(String s [ ] ) { System.out.println(“Hello World”); } } // end class MyApp

Constructors All objects are created through constructors They are invoked automatically class Weight { int lb; int oz; public Weight (int a, int b ) { lb = a; oz = b; }

access modifiers same class only everywhere private same class only public everywhere protected same class, same package, any subclass (default) same class, same package

final keyword variables (makes a var. constant), or means “constant” applies to variables (makes a var. constant), or methods (makes a method non-overridable), or classes (makes a class non-subclassable means “objects cannot be created”).

final keyword with a variable class Math { public final double pi = 3.1412; public static double method(double x) { double x = pi * pi; } note: variable pi is made “read-only”

final keyword with a method class Employee { protected String name; protected double salary; public final void raise(double dd) { salary += salary * dd/100; } public Employee ( … ) { … } then: cannot ovveride method raise() inside the Manager class

final keyword with a class final class Employee { protected String name; protected double salary; public void raise(double dd) { salary += salary * dd/100; } public Employee ( … ) { … } then: cannot create class Manager as a subclass of class Employee (all are equal)

A Look Inside the Java Platform Applets and Applications Java Base API Java Base Classes Java Standard Extension API Java Standard Extension Classes The Java Base Platform (in black) Java Virtual Machine Porting Interface Adapter Browser OS Hardware Adapter OS Hardware Adapter OS Hardware JavaOS Hardware Network Java on a Browser Java on a Desktop OS Java on a Smaller OS Java on JavaOS