Introduction to By Mati Yanko. Primary Goals of Java Portable Secured Object Oriented.

Slides:



Advertisements
Similar presentations
Dynamic Memory Allocation in C.  What is Memory What is Memory  Memory Allocation in C Memory Allocation in C  Difference b\w static memory allocation.
Advertisements

Introduction to Memory Management. 2 General Structure of Run-Time Memory.
Introduction to Assembly language
Chris Riesbeck, Fall 2007 Dynamic Memory Allocation Today Dynamic memory allocation – mechanisms & policies Memory bugs.
Introduction to Java Objects CSIS 3701: Advanced Object Oriented Programming.
Lecture 10: Part 1: OO Issues CS 540 George Mason University.
Portability and Safety Mahdi Milani Fard Dec, 2006 Java.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Memory allocation CSE 2451 Matt Boggus. sizeof The sizeof unary operator will return the number of bytes reserved for a variable or data type. Determine:
Lab#1 (14/3/1431h) Introduction To java programming cs425
The Java Language. Topics of this Course  Introduction to Java  The Java Language  Object Oriented Programming in Java  Exceptions Handling  Threads.
1 Day 03 Introduction to C. 2 Memory layout and addresses r s int x = 5, y = 10; float f = 12.5, g = 9.8; char c = ‘r’, d = ‘s’;
CSE 2501 Review Declaring a variable allocates space for the type of datum it is to store int x; // allocates space for an int int *px; // allocates space.
JETT 2003 Java.compareTo(C++). JAVA Java Platform consists of 4 parts: –Java Language –Java API –Java class format –Java Virtual Machine.
Programming Language Semantics Java Threads and Locks Informal Introduction The Java Specification Language Chapter 17.
Run-Time Storage Organization
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
Abstract data types & object-oriented paradigm. Abstraction Abstraction: a view of an entity that includes only the attributes of significance in a particular.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles C/C++ Emery Berger and Mark Corner University of Massachusetts.
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 Memory Model of A Program, Methods Overview l Memory Model of JVM »Method Area »Heap »Stack.
Peter Juszczyk CS 492/493 - ISGS. // Is this C# or Java? class TestApp { static void Main() { int counter = 0; counter++; } } The answer is C# - In C#
OOP Languages: Java vs C++
Principles of Computer Programming (using Java) Review Haidong Xue Summer 2011, at GSU.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
Programming Languages and Paradigms Object-Oriented Programming.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
OOPs Object oriented programming. Based on ADT principles  Representation of type and operations in a single unit  Available for other units to create.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Object Oriented Programming: Java Edition By: Samuel Robinson.
Lecture 10 : Introduction to Java Virtual Machine
Chapter 2: Everything is an Object ● C++ has many non object oriented features inherited from C. It is a hybrid language meaning that it support different.
Programming Languages and Paradigms Object-Oriented Programming (Part II)
Algorithm Programming Bar-Ilan University תשס"ח by Moshe Fresko.
1 Comp 104: Operating Systems Concepts Java Development and Run-Time Store Organisation.
Programming Languages and Paradigms Object-Oriented Programming.
Module Overview n Module Title: OO Programming n Module Code: MIT3446 n Module Value: 3.0 n Duration: 15 weeks n Class-Contact Hours: Lecture15 hrs n Lab/Tutor30hrs.
Stack and Heap Memory Stack resident variables include:
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
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.
Introduction to Object Oriented Programming CMSC 331.
Week 14 - Monday.  What did we talk about last time?  Introduction to C++  Input and output  Functions  Overloadable  Default parameters  Pass.
Java Objects and Classes. Overview n Creating objects that belong to the classes in the standard Java library n Creating your own classes.
Java Security Model For Mobile Code Abdo Achkar. Mobile Code A mobile object is a “self contained piece” of executable code. Definition:  Code that can.
Polymorphism. 3 main programming mechanisms that constitute OOP: 1. Encapsulation 2. Inheritance 3. Polymorphism.
Lists, Stacks and Queues in C Yang Zhengwei CSCI2100B Data Structures Tutorial 4.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
CT1513 Introduction To java © A.AlOsaimi.
Object-Oriented Programming Simple Stack Implementation.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Java Basics Opening Discussion zWhat did we talk about last class? zWhat are the basic constructs in the programming languages you are familiar.
1. An Introduction A Programming Language A Technology Java Development Kit Java API One Language: Three Editions Standard Edition Enterprise Edition.
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
OOPs Object oriented programming. Abstract data types  Representationof type and operations in a single unit  Available for other units to create variables.
Programming Languages and Paradigms Activation Records in Java.
1 Lecture07: Memory Model 5/2/2012 Slides modified from Yin Lou, Cornell CS2022: Introduction to C.
Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Assignment 3 is due Sunday, the 8 th at 7pm. Today: –Two simple binding examples. –Function Hiding.
RealTimeSystems Lab Jong-Koo, Lim
Object Oriented Programming CMSC 331. Concept of Abstraction “An abstraction is a view or representation of an entity that includes only the attributes.
Memory Management in Java Mr. Gerb Computer Science 4.
Objects and Memory Mehdi Einali Advanced Programming in Java 1.
OBJECT ORIENTED PROGRAMMING
ENEE150 Discussion 07 Section 0101 Adam Wang.
Introduction Enosis Learning.
Introduction Enosis Learning.
CSC 253 Lecture 8.
CSC 253 Lecture 8.
Variables and Java vs C++
Introducing Java.
Run-time environments
Presentation transcript:

Introduction to By Mati Yanko

Primary Goals of Java Portable Secured Object Oriented

Portable – Platform Independent

Secured ByteCode instructions Download through Network Verify Code Run it Network

Object Oriented Programming Encapsulation Inheritance Polymorphism

Object Oriented Programming What is an Object ? Variables (state) Methods (behavior)

static int* buffer; static int counter; void initStack() { buffer = (int*)malloc( sizeof(int) * 10); counter=0; } void freeStack() { free(buffer); } int pop() { return buffer[-- counter]; } void push(int number) { buffer [counter ++]=number; } int main() { initStack(); push(3); pop(); freeStack(); }

public class Stack { private int buffer []; private int counter; Stack() { buffer = new int[10]; counter=0; } void printStack { … } int getCounter() { return counter;} void push (int number) { buffer[counter++] =number; } int pop() { return buffer[ - - counter]; } } Data members (state) Methods (behaviour)

public void main() { Stack myStack=new Stack(); // memory allocation myStack.push(3); myStack.pop(); mystack.pop();// oops }

Object Oriented Programming What is Inheritance ? Stack Stack with Buffer underflow check

public class betterStack extends Stack { int pop() { if (getCounter() >= 0) return super.pop();// superclass method } public void main() { betterStack myStack=new betterStack(); myStack.push(3); myStack.pop(); mystack.pop();// ok }

Object Oriented Programming What is Polymorphism ? Public void main() { Stack myStack;// myStack is null betterStack newStack=new betterStack(); myStack = newStack; myStack.pop() ; // ??? }

C vs. Java Macros Low-level memory management Pointer arithmetic p++ Casts Free Unsafe arrays Stack allocation Big and small values Object Oriented Dynamic class loading References instead of arbitrary pointers Heap only No free (Garbage collection) Exceptions

References Java programming Language / SUN