CISC124 From Thursday: Course Web Site:

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

1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore G54PRG Programming Lecture 1 Amadeo Ascó 3 Java Programming Language.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
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.
1 Fall 2008ACS-1903 Chapter 1 Topics Java History Java Programs Why Program? Computer Systems: Hardware and Software Programming Languages What Is a Program.
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
LESSON 1 INTRODUCTION Compiled By: Edwin O. Okech [Tutor, Amoud University] JAVA PROGRAMMING.
CMSC 202 Computer Science II for Majors Fall 2009 Introduction.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Advanced OOP MCS-3 OOP BSCS-3 Lecture # 1
CSC 142 A 1 CSC 142 Introduction to Java [Reading: chapter 0]
Chapter 1 Coding Introduction.
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
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 Sharif University of Technology Fall 2010.
Java Beserkers Group 4. Start of Java Development began on June of 1991 by a group of computer scientist at the Sun Mircrosystems Company Development.
CMSC 202 Computer Science II for Majors Object-Oriented Programming.
Computer Programming 12 Mr. Jean March 19 th, 2013.
Sadegh Aliakbary Sharif University of Technology Fall 2012.
Java ACO101: Introduction to Computer Science. The History of Java Started out as a research project at Sun Microsystems in 1991 Code named “Green” Based.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Session 1 Introduction to Java. Objectives Java Simplified / Session 1 / 2 of 32 Explain the history of Java Explain Java in brief List the types of Java.
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.
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.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Java Basics 1 Brief History of Java and Overview of Langauge.
© 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.
introductory lecture on java programming
Java – in context Main Features From Sun Microsystems ‘White Paper’
©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. CSC 110 – INTRO TO COMPUTING - PROGRAMMING Overview of Programming.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Introduction to Programming 1 1 2Introduction to Java.
Introduction to JAVA Programming
CMSC 202 Computer Science II for Majors Fall 2010 Introduction Version 9/101.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Introduction CMSC 202 Fall Instructors Mr. Ryan Bergeron – Lecture Section 01 Tues/Thu 1:00 – 2:15 am, Sondheim 111 – Lecture Section 04 Tues/Thu.
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.
Chapter 1 Coding Introduction.
Applications Active Web Documents Active Web Documents.
Object Oriented Programming in
Done By: Ashlee Lizarraga Ricky Usher Jacinto Roches Eli Gomez
Chapter 1 Introduction to Computers, Programs, and Java
Chapter No. : 1 Introduction to Java.
Lecture 1: Introduction to JAVA
Topic: Difference b/w JDK, JRE, JIT, JVM
Java History Background information about Java and how the background affected it’s development 1.
Text by: Lambert and Osborne
CISC/CMPE320 - Prof. McLeod
Chapter 2 First Java Programs
Java programming lecture one
Introduction Enosis Learning.
Introduction Enosis Learning.
Chapter 1 Coding Introduction.
CMPE212 – Stuff… Course Web Site:
Introduction CSC 111.
(Computer fundamental Lab)
Java History, Editions, Version Features
CMPE212 – Reminders Course Web Site:
CSC 142 Introduction to Java [Reading: chapters 1 & 2]
Review of Previous Lesson
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:

CISC124 From Thursday: Course Web Site: Fall 2018 CISC124 2/1/2019 CISC124 From Thursday: Course Web Site: http://research.cs.queensu.ca/home/cisc124w Lecture notes and other stuff will be, and is posted. Note Fall 2018 CISC124 - Prof. McLeod Prof. Alan McLeod

“To Do” List from Thursday Review course web site. Check onQ login. Fill out lab section quiz in onQ. (106 done) Install Eclipse, if you want to use this IDE – see the Resources page. Start Exercise 1. This covers console I/O and will not be discussed in class. At a minimum – do Exercises 1 and 3 before starting assignment 1. Fall 2018 CISC124 - Prof. McLeod

Today “Hello World” Ritual! History of Java. How Java Works. Start Class Structure. Emphasis on syntax for now. Fall 2018 CISC124 - Prof. McLeod

First Example – “Hello World” in Java Let us have a quick look at Eclipse, create an empty project and add a program that displays “Hello World” to the console window. Tradition! Fall 2018 CISC124 - Prof. McLeod

First Java Program… What do you think? How would you have done “Hello World” in Python? Is all this extra “stuff” necessary? Can any code be removed without breaking the program? Fall 2018 CISC124 - Prof. McLeod

A Very Brief History of Java The language was first developed by James Gosling at Sun Microsystems in 1991. He was designing a language, called “Oak”, for the “Green Project”. The Green Project envisaged the centralized control of many processor-based devices in the home. “Oak” was designed to be a robust, efficient language with maximum portability to different processors. The Green Project flopped… Fall 2018 CISC124 - Prof. McLeod

Java History, Cont. What else happened in the early 90’s? Internet use started to blossom in the early 90’s. Web pages had to do more than just display static text and graphics. Needed dynamic and interactive content. But, web pages are viewed on a wide variety of platforms, from Mac’s to Unix to IBM-PC’s. So any page-embedded language would need to run on all these platforms. Needed a robust, compact, multiplatform language, so let’s dust off Oak and call it something racy like “Java”! Fall 2018 CISC124 - Prof. McLeod

Java History, Cont. In 1994, Sun demonstrated the use of Java in small bundles of code embedded in a web page - called applets. Netscape browsers started supporting applets in 1995, starting Java’s rise to fame. Sun programmers continued to develop a code base for the language, adding many libraries. They showed that Java could be used for more than just applets, and that full-blown applications could be written in this high-level language. Fall 2018 CISC124 - Prof. McLeod

Slightly More Recent History Early in 2010 Oracle acquired Sun Microsystems. Here’s a statement regarding Java from Oracle: “Oracle plans to accelerate investment in the Java platform for the benefit of customers and the Java community. Java is one of the computer industry’s best-known brands and the Java platform is one of the industry’s most widely deployed technologies. Oracle has been a leader in the Java community since the inception of the Java programming language and already has the world’s largest investment in the Java platform, which provides the foundation for its Oracle Fusion Middleware products and its next-generation enterprise applications. Oracle plans to not only broaden and accelerate its own investment in the Java platform, but also plans to increase the commitment to the community that helps make Java an ubiquitous, innovative platform unified around open standards.” Fall 2018 CISC124 - Prof. McLeod

Slightly More Recent History, Cont. Oracle seems to be sticking with their promise as demonstrated with the releases of Java 7 & 8. Now, we are using Java 10. The second “incarnation” of JavaFX has also been released, replacing Swing. Now, Oracle is promising a new release of Java every 6 months. Fall 2018 CISC124 - Prof. McLeod

How Java Works The Java language standard (the syntax) is identical for all platforms. A compiler ( part of the “JDK”, or “Java Development Kit” – sometimes called javac.exe) which is designed to run on your development platform, compiles your source code (*.java file) to a byte code file (*.class file). The byte code file is platform-independent, and is the thing you would attach to your web page as an applet. Every browser written for every platform and OS, can have an embedded code processor called a JVM, or “Java Virtual Machine”, built-in. Fall 2018 CISC124 - Prof. McLeod

How Java Works, Cont. The JVM takes the byte code and executes it by generating the machine code that will be recognized by the platform that is running the browser. Local Client Remote File Server Browser HTML File Internet JVM Applet Applet Byte code files Fall 2018 CISC124 - Prof. McLeod

How Java Works, Cont. Of course it did not take long before people took the JVM out of the browser so that they could run stand-alone Java applications. This is the JRE or “Java Runtime Engine” (java.exe). The concept of write once, run anywhere is very appealing! “Save your $$!” And, Oracle distributes the JDK’s for free, making development on many platforms inexpensive. Java now has over 9 million application programmers worldwide. No other language has ever grown this quickly! Fall 2018 CISC124 - Prof. McLeod

How Java Works, Cont. So, Java can be used either to create applets for use in web pages or for stand-alone applications. Most “Integrated Development Environments” or IDEs will support the development of either kind of program. However applets have fallen out of favour in the last few years due to security concerns. Fall 2018 CISC124 - Prof. McLeod

Aside – Stand Alone Java Apps? Pretty much every computer will have a version of the Java JRE installed for its web browser. Can you take advantage of that? Yes! One increasingly popular option is the use of executable JAR files. You can just double click on them and they run. Fall 2018 CISC124 - Prof. McLeod

How Java Works, Cont. All IDE’s, including Eclipse, must use the appropriate JDK in the background. Two components of the JDK are the programs “javac.exe” and “java.exe”. javac.exe is the byte code compiler, and java.exe is the JRE which executes the byte code file. “Compilation” is the process of converting the *.java file to a *.class file (the byte code file). This is done by calling javac.exe in the background, and supplying that program with all the required command line parameters. Fall 2018 CISC124 - Prof. McLeod

How Java Works, Cont. The java.exe program: accepts the byte code file, links in any required libraries, creates executable code in memory converts it to machine language and sends it to the CPU. The java.exe program must know the right machine language commands for just the type of CPU it is designed for! Also called “Just in Time” compilation or “JIT”. Fall 2018 CISC124 - Prof. McLeod

Eclipse Source Text Editor text successful Bytecode binary Compiler Executable not successful binary Linker Errors javac.exe Loader Library binary Output Data Input Data java.exe Fall 2018 CISC124 - Prof. McLeod

Questions: Suppose we have two kinds of errors: Syntax errors Runtime errors What is the difference? Considering the two step process of running a Java program, at what stages will these errors be caught and who does the catching? Who does the fixing??? Fall 2018 CISC124 - Prof. McLeod