Introduction to Java CSIS 3701: Advanced Object Oriented Programming.

Slides:



Advertisements
Similar presentations
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Advertisements

Designing a Program & the Java Programming Language
1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore G54PRG Programming Lecture 1 Amadeo Ascó 3 Java Programming Language.
In Review JAVA C++ GUIs - Windows Webopedia.com.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Lab#1 (14/3/1431h) Introduction To java programming cs425
Java.  Java is an object-oriented programming language.  Java is important to us because Android programming uses Java.  However, Java is much more.
got ? Research Project – April 1998 Hang Xia, Mark Wang, Richard S. Chang Updated: R Norman, August 1999.
IC211 Object Oriented Programming Overview of Java.
Java: History and Introduction (Lecture # 1). History… Java – Based on C and C++ – Developed in 1991 for intelligent consumer electronic devices – Green.
Lecture 2: Do you speak Java?. From Problem to Program Last Lecture we looked at modeling with objects! Steps to solving a business problem –Investigate.
Introduction to Java Kiyeol Ryu Java Programming Language.
Prepared By E.Musa Alyaman1 Chapter 2 The Java Overview.
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
LESSON 1 INTRODUCTION Compiled By: Edwin O. Okech [Tutor, Amoud University] JAVA PROGRAMMING.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Java Security Updated May Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
CSC 142 A 1 CSC 142 Introduction to Java [Reading: chapter 0]
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Sadegh Aliakbary Sharif University of Technology Spring 2011.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
University of Houston-Clear Lake Proprietary© 1997 Evolution of Programming Languages Basic cycle of improvement –Experience software difficulties –Theory.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Lecture :2 1.  DEFENTION : Java is a programming language expressly designed for use in the distributed environment of the Internet. It was designed.
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
CPRG 215 Introduction to Object-Oriented Programming with Java Module 1-Introduction to Java Topic 1.1 Basics of Java Produced by Harvey Peters, 2008 Copyright.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Java Simple Types CSIS 3701: Advanced Object Oriented Programming.
What Is Java? According to Sun in a white paper: Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture-neutral, portable,
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
Getting started with Programming using IDE. JAVA JAVA IS A PROGRAMMING LANGUAGE AND A PLATFORM. IT CAN BE USED TO DELIVER AND RUN HIGHLY INTERACTIVE DYNAMIC.
CT1513 Introduction To java © A.AlOsaimi.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
Copyright © Mohamed Nuzrath Java Programming :: Syllabus & Chapters :: Prepared & Presented By :: Mohamed Nuzrath [ Major In Programming ] NCC Programme.
A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well.
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.
By: Cheryl Mok & Sarah Tan. Java is partially interpreted. 1. Programmer writes a program in textual form 2. Runs the compiler, which converts the textual.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
Java – in context Main Features From Sun Microsystems ‘White Paper’
Getting Started With Java September 22, Java Bytecode  Bytecode : is a highly optimized set of instructions designed to be executed by the Java.
1 Introduction Read D&D Sec 1.8; Sec 1.13 THE Java tutorial -
Introduction to JAVA Programming
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Chapter 1 Coding Introduction.
Applications Active Web Documents Active Web Documents.
Object Oriented Programming in
CSCI-235 Micro-Computer Applications
Chapter 1 Introduction to Computers, Programs, and Java
Lecture 1: Introduction to JAVA
Introduction to.
Java programming lecture one
Advanced Programming Fall 2017.
Introduction CSC 111.
(Computer fundamental Lab)
Java History, Editions, Version Features
Object-Oriented Programming Using Java
Programming language translators
Presentation transcript:

Introduction to Java CSIS 3701: Advanced Object Oriented Programming

Java Background Original purpose: web page applets –Executable/dynamic applications running on web page –No longer main use, but affected language design Server applet Client browser requested by browser copy downloaded to browser applet Java code executed on client computer

Platform Independence Java applet must run on any client –Different OS, architecture, etc.  different machine code –Cannot compile applet to single executable used by all Stage 1: Java source code compiled to “byte code” –Code for an abstract “Java virtual machine” (JVM) Hello.java Source code (must end in.java ) Hello.class Byte code stored on server

Platform Independence Stage 2: JVM on client runs “byte code” –Converted to native machine code line-by line and executed on the fly –JVM can be: Part of browser Built into NetBeans Run separately from command line ( java Hello.class ) Built directly into chip (mobile devices) browser applet Line 1 Line 2 Line 3 Line 4 … Client JVM processor convert and execute

Security and Safety Applet = unknown code running on your computer! –How to prevent malicious applets? Applets vs. Applications –Applets not allowed access to local files, network, etc. –Application: separate standalone process not run in browser

Security and the Sandbox All Java programs execute in restricted area of memory (the “sandbox”) No explicit pointers –int *ptr = 100; // outside sandbox –*ptr = 0; // overwrite that memory Array bounds checking –int A[100]; –A[ ] = 0; // outside sandbox

Safety and Exception Handling Java programs cannot “crash” to OS Exceptions caught and handled within JVM –Browser/NetBeans/etc. notified –Can handle as needed (error message displayed, etc.) applet JVM int x = 0/0; ArithmeticException thrown ;

Tradeoffs Many tradeoffs in language design –No “best” choices –Different languages make different choices Portability vs. Speed –“On the fly” interpretation slower than direct execution of machine code Safety vs. Speed –Array bounds checking –Exception handling Require extra time

Basic Java Syntax Java syntax mostly same as C++ –Java developed by C++ programmers Examples –Lines/blocks: ; {} –Control structures: if else for while switch … –Operators: = + - * / = … == != > = <= && || … –Comments: /* */ //