JETT 2003 Java.compareTo(C++). JAVA Java Platform consists of 4 parts: –Java Language –Java API –Java class format –Java Virtual Machine.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
Java security (in a nutshell)
1 1 Lecture 14 Java Virtual Machine Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
The road to reliable, autonomous distributed systems
Introduction to Java The objectives of this chapter are: To describe the key aspects of Java To describe the Java software development kit (SDK) To explain.
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.
Introduction to Java Kiyeol Ryu Java Programming Language.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
For more Lectures and Notes Visit
Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
1 Software Testing and Quality Assurance Lecture 31 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
Introduction to Java Programming Language Junji Zhi University of Toronto 1.
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
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.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
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#
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 Security Updated May Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security.
Intro to Java The Java Virtual Machine. What is the JVM  a software emulation of a hypothetical computing machine that runs Java bytecodes (Java compiler.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
Application Security Tom Chothia Computer Security, Lecture 14.
Arpit Jain Mtech1. Outline Introduction Dalvik VM Java VM Examples Comparisons Experimental Evaluation.
1 The Java Virtual Machine Yearly Programming Project.
Implement High-level Program Language on JVM CSCE 531 ZHONGHAO LIU ZHONGHAO LIU XIAO LIN.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Lecture 10 : Introduction to Java Virtual Machine
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Algorithm Programming Bar-Ilan University תשס"ח by Moshe Fresko.
1 Comp 104: Operating Systems Concepts Java Development and Run-Time Store Organisation.
University of Houston-Clear Lake Proprietary© 1997 Evolution of Programming Languages Basic cycle of improvement –Experience software difficulties –Theory.
1 Introduction to JVM Based on material produced by Bill Venners.
Java Virtual Machine Case Study on the Design of JikesRVM.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
C# Versus Java Author: Eaddy, Marc Source: Software Tools for the Professional Programmer. Dr. Dobb's Journal. Feb2001, Vol. 26 Issue 2, p74 Hong Lu CS699A.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
Copyright © Mohamed Nuzrath Java Programming :: Syllabus & Chapters :: Prepared & Presented By :: Mohamed Nuzrath [ Major In Programming ] NCC Programme.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
1. An Introduction A Programming Language A Technology Java Development Kit Java API One Language: Three Editions Standard Edition Enterprise Edition.
Java: An Overview John R Durrett Texas Tech University.
Java -- A very Hot Object- Oriented Language Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of.
Programming Languages and Paradigms Activation Records in Java.
RealTimeSystems Lab Jong-Koo, Lim
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Introduction to JAVA Programming
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
(Not too) Real-Time JVM (Progress Report)
Object Oriented Programming in
Java™ 2 Platform Getting Started.
Multitasking without Compromise: a Virtual Machine Evolution
Chapter 1 Introduction to Computers, Programs, and Java
Java security (in a nutshell)
Introduction Enosis Learning.
CMPE419 Mobile Application Development
Introduction Enosis Learning.
Java Byte Codes (0xCAFEBABE) cs205: engineering software
CSc 453 Interpreters & Interpretation
Java History, Editions, Version Features
CMPE419 Mobile Application Development
M S COLLEGE ART’S, COMM., SCI. & BMS
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

JETT 2003 Java.compareTo(C++)

JAVA Java Platform consists of 4 parts: –Java Language –Java API –Java class format –Java Virtual Machine

Java - the Language Java minimizes debugging and maximizes productivity –Features that are build-in into Java: OO, Reflection & multithreading Multiple Interface Inheritance Distributed, portable & secure Architecture neutral (utilizing bytecode) JIT, Garbage Collected & well-understood

Programming Constructs Tradeoffs Java Language syntax is simpler –C/C++ Constructs that are NOT present in Java: Destructors, Operator overloading Multiple class inheritance Header files & preprocessor Pointers, goto, enumerations, structures & unions Global functions HelloUniverse & HelloWorld DEMO

Bytecode vs Shellcode Bytecode Method float add(float, int) 0 fload_1 1 iload_2 2 i2f 3 fadd 4 freturn Assembly push %ebp mov %esp,%ebp fildl 0x10(%ebp) fadds 0xc(%ebp) pop %ebp ret

Java Platform Stacks Thread Stack Global Heap Method Operand Stack Local Variables Table Stack frame Exec Envirmt

C/C++ Family Stacks Kernel Virtual Memory (code, data, heap, stack) System Stack (Linux) Method Invocation Stack Segment Shared Libraries region … User Stack … malloc heap Segments Loaded from Exec file. Void foo(int k, int m) { int buffer[15]; } bufferFPSPkm

C++ vs. Java Stack Security Memory Scan DEMO BOF Attack DEMO Both DEMO’s will NOT work in Java –Cannot use NULL reference in Java –methods have individual operand stacks –Java API dynamically linked

Java API Java 2 Platform API Editions: –Enterprise Edition (J2EE) –Standard Edition (J2SE) –Micro Edition (J2ME) Java code no longer runs everywhere, only where appropriate JVM & API are installed (still better than recompiling for every host)

0xCAFEBABE magic0xCAFEBABE4 bytes version...4 bytes constant pool...9th byte ( starts with it's own length ) Access flags…2 bytes ( directly after the constant pool are the access flags ) this class… super class… and so on...…

C-Family API & Executables C-Family executables are virtually monolithic, which requires to compile a version for each host type As in Java, all libraries must be installed on the host beforehand –This is much harder than in Java, since virtually every company has its own libraries to use

Java Virtual Machine (VM) Class Loader Bytecode Execution Engine Java APIYour Code bytecode Native shellcode Class Bytecode Verifier

Java Language DEMOs String DEMO –String Object –Performance –Structured Exception Handling Reference DEMO –Synchronization –Passing by reference –Inner classes

Java GC - Generational Young (collected by Copying) –Eden, 2 survivor spaces & Virtual Old (collected by Mark-Compact) –Permanent, Standard & Virtual Perm StandardVirtual Eden Survivor Spaces Virtual Old Generation Young Generation

C Malloc / C++ New Malloc list pointer User Space Address returned to the user SIZE Low addressHigh address.... Does NOT belong to malloc....

Java Bytecode Portability Java does provide relatively mobile code –MadeInWindows DEMO –MadeInSolaris DEMO C++ provides no illusions on its hardware architecture dependence – C++ counts on it

Java Pros & Cons Pros –Distributed, Network Oriented –Fast Development and Easy Reuse –GC, multithreaded, buld-in synchronization –Stack, heap, array & string security Cons –Easily Decompiled –Cannot be used in real-time systems