Java for C++ Programmers Clint Jeffery University of Idaho

Slides:



Advertisements
Similar presentations
A Programmer's Introduction to Java - from a S/370 user (c) IDMS/SQL News
Advertisements

Portability and Safety Mahdi Milani Fard Dec, 2006 Java.
Date: Subject:Distributed Data Processing Name:Maria Br ü ckner.
Introduction to JAVA Vijayan Sugumaran School of Business Administration Oakland University Rochester, MI
Object Oriented Programming in JAVA
The Java Language. Topics of this Course  Introduction to Java  The Java Language  Object Oriented Programming in Java  Exceptions Handling  Threads.
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
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.
1 Java Basics. 2 Compiling A “compiler” is a program that translates from one language to another Typically from easy-to-read to fast-to-run e.g. from.
Introduction to Java Kiyeol Ryu Java Programming Language.
Principles of Object-Oriented Software Development The language Java.
1 Crash Course in Java Based on notes from D. Hollinger Based in part on notes from J.J. Johns also: Java in a Nutshell Java Network Programming and Distributed.
Introduction to Java CS 331. Introduction Present the syntax of Java Introduce the Java API Demonstrate how to build –stand-alone Java programs –Java.
Slide 1 of 40. Lecture A The Java Programming Language Invented 1995 by James Gosling at Sun Microsystems. Based on previous languages: C, C++, Objective-C,
Netprog 2002 Java Intro1 Crash Course in Java Based on notes from D. Hollinger Based in part on notes from J.J. Johns also: Java in a Nutshell Java Network.
Introduction to Java Programming Language Junji Zhi University of Toronto 1.
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.
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.
CMSC 341 Introduction to Java Based on tutorial by Rebecca Hasti at
1 CSC 551: Web Programming Spring 2004 Java Overview  Design goals & features  platform independence, portable, secure, simple, object-oriented, … 
C++ for Java Programmers Chapter 1 Basic Philosophical Differences.
Java Programming CIS 421 Web-Based Java Programming.
+ Java vs. Javascript Jessi Style. + Java Compiled Can stand on its own Written once, run anywhere Two-stage debugging Java is an Object Oriented Programming.
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Java Workshop for Teachers May 6, 2005 A Brief Look at the Java Programming Language.
Sadegh Aliakbary Sharif University of Technology Spring 2011.
Introduction to Java Tavaris J. Thomas Ph.D. BNAI ZION SCIENTISTS DIVISION JOB ORIENTATION & TERMINOLOGY CLASSES Fall 2012.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Centre for Computer Technology ICT214 Object Oriented Design and Programming Week 1 - Introduction Richard Salomon and Umesh Patel Centre for Information.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
May 9, 2002Serguei A. Mokhov, 1 Kickstart Intro to Java Part I COMP346/ Operating Systems Revision 1.6 February 9, 2004.
CS591x A very brief introduction to Java. Java Developed by Sun Microsystems was intended a language for embedded applications became a general purpose.
2: Everything is an Object You Manipulate Objects Using References Primitives Arrays in Java Scoping You Never Destroy Objects Creating New Data Types:
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.
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.
1 Introduction to Java. 2 What is Java? A programming language. A platform –A virtual machine (JVM) definition. –Runtime environments in diverse hardware.
Objects, Classes and Syntax Dr. Andrew Wallace PhD BEng(hons) EurIng
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
Java -- A very Hot Object- Oriented Language Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
We will talking about story of JAVA language. By Kristsada Songpartom.
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.
Java Basics 1 Brief History of Java and Overview of Langauge.
Java -- A very Hot Object- Oriented Language Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of.
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.
Duke CPS From C++ to Java l Java history: Oak, toaster-ovens, internet language, panacea l What it is ä O-O language, not a hybrid (cf. C++)
OOP Basics Classes & Methods (c) IDMS/SQL News
Features of JAVA PLATFORM INDEPENDENT LANGUAGE JAVA RUNTIME ENVIRONMENT (JRE) JAVA VIRTUAL MACHINE (JVM) JAVA APP BYTE CODE JAVA RUNTIME ENVIRONMENT.
Object Oriented Programming Lecture 2: BallWorld.
Spring 2006 Special Topics in Computer Engineering: Java Intro 1 Crash Course in Java Based on notes from D. Hollinger Based in part on notes from J.J.
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.
Java™ 2 Platform Getting Started.
Intro to ETEC Java.
Chapter No. : 1 Introduction to Java.
Internet and Java Foundations, Programming and Practice
Website: SSD1 Unit 2 Intro to Java Presentation 2.3 Website:
Units with – James tedder
Units with – James tedder
(Computer fundamental Lab)
Java History, Editions, Version Features
Presentation transcript:

Java for C++ Programmers Clint Jeffery University of Idaho

Object Oriented Programming Object Oriented Design comes first. Objects originated in application domains. OOP first appeared in SIMULA 67 classes and inheritance mixed w/ normal code Popularized by SmallTalk 80 everything is an object, even integers! Method call == “send an object a message”

History of Java Designed by Gosling et al at Sun ~1991 Original niche: embedded programming w/ GUIs, such as cable TV boxes Portability based on bytecode VM Happy Accident: retargeted for browsers just in time for Internet boom, 1995 Moves largely onto enterprise servers by 1999 or so Achieves 50+% university penetration, ~2005 Returns to its roots in Android, ~2008

Java Design Principles Simple, object-oriented, familiar Robust and secure Architecture neutral and portable Interpreted, threaded, and dynamic High performance (?)

Java as a Better C++ Familiar == C/C++-like syntax Tries to avoid main sources of bugs and security flaws in C++ code: pointers, memory allocation, type safety, preprocessor Tries to be more Object-Oriented: everything is in a class Tries to be easier and simpler than C++ Tries to be amenable to large projects worked on by worker-bee programmers

Java as a Worse C++ Slow, slow, and slow compared w/ C/C++ Despite garbage collection, you can still have memory problems Neither C++ nor Java retains backward compatibility w/ old code. Ridiculous class libraries...complex operations for simple tasks. Have to use their package/directory structure...like it or not.

Java Hello World public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World"); } Must be in a HelloWorld.java Each.java can have its own main() Compile.java to.class with javac Run.class with java, or build a.jar

Java Hello World Notice how you can't write code outside a class, and can't write a class except in its proper file...but you are able to run main() even though there is no instance of class HelloWorld. Static class functions fly in the face of “pure OOP”. Also, Java's built-in types (like int) are not objects, so “more pure than C++” does not mean “pure OO”

Java Types byte, short, int, long, float, double, boolean, char (16-bit, Unicode) – Precision/size generally guaranteed across platforms Arrays – size fixed at creation Objects – instances of a class. Lots of important standard classes, like strings