IT151: Introduction to Programming (java)

Similar documents
Getting Started with Java. Atul Prakash

CHAPTER 1. Introduction to JAVA Programming

Code Ninjas: Introduction to Computer Science. Macomb Science Olympiad Presented by Swati Dharia

3 CREATING YOUR FIRST JAVA APPLICATION (USING WINDOWS)

Lecture 4: Introduction to Java and your Development Environment

Instructions. First, download the file

Lecture 1: Overview of Java

Certified Core Java Developer VS-1036

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

CHAPTER 1 Introduction to Computers and Java

Fundamentals of Programming. By Budditha Hettige

C02: Overview of Software Development and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

Chapter 1: Introduction to Computers and Java

Lesson 04: Our First Java Program (W01D4

History of Java. Java was originally developed by Sun Microsystems star:ng in This language was ini:ally called Oak Renamed Java in 1995

lejos NXJ Problem Solving with Robots [PRSOCO601]

Goals. Java - An Introduction. Java is Compiled and Interpreted. Architecture Neutral & Portable. Compiled Languages. Introduction to Java

JVM interprets the Java bytecode, controls how it interacts with the operating system and manages memory.

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017

Java Programming Language Mr.Rungrote Phonkam

Java Programming. Manuel Oriol, March 22nd, 2007

From High Level to Machine Code. Compilation Overview. Computer Programs

Getting Started with Eclipse/Java

Javac and Eclipse tutorial

The Command Shell. Fundamentals of Computer Science

Programming. Syntax and Semantics

Index. Course Outline. Grading Policy. Lab Time Distribution. Important Instructions

Supplement B. Creating, Compiling and Running Java Programs from the Command Window

Lecture (01) Getting started. Dr. Ahmed ElShafee

1. Introduction. Java. Fall 2009 Instructor: Dr. Masoud Yaghini

CompSci 125 Lecture 02

CSC116: Introduction to Computing - Java

Chapter 1 Introduction to Computers, Programs, and Java

assembler Machine Code Object Files linker Executable File

The Java Technical Details. ICW Lecture 3 Tom Chothia

Introduction to Java

Programming Principles 1 (CSC131) & 2 (CSC132) Software usage guide

CS110/CS119 Introduction to Computing (Java) Bob Wilson S-3-176

Introduction to Java. Nihar Ranjan Roy.

Lesson 2: First Java Programs

CSC116: Introduction to Computing - Java

Introduction to Java Programming

Tutorial 1 CSC 201. Java Programming Concepts عؾادئماظربجمةمبادؿكدامماجلاصا

CSC116: Introduction to Computing - Java

Class 1: Homework. Intro to Computer Science CSCI-UA.0101 New York University Courant Institute of Mathematical Sciences Fall 2017

Outline. Parts 1 to 3 introduce and sketch out the ideas of OOP. Part 5 deals with these ideas in closer detail.

CSE 421 Course Overview and Introduction to Java

Introduction to Java. Java Programs Classes, Methods, and Statements Comments Strings Escape Sequences Identifiers Keywords

INFO Object-Oriented Programming

Computer Hardware. Java Software Solutions Lewis & Loftus. Key Hardware Components 12/17/2013

Running Java Programs

Department of Computer Science. Software Usage Guide. CSC132 Programming Principles 2. By Andreas Grondoudis

Kickstart Intro to Java Part I

Chapter 2 First Java Programs

CS 11 java track: lecture 1

Life Without NetBeans

Eclipse. JVM, main method and using Eclipse. Dr. Siobhán Drohan. Produced by: Department of Computing and Mathematics

CS 177 Recitation. Week 1 Intro to Java

Programming Language Concepts: Lecture 2

Computer Programming-1 CSC 111. Chapter 1 : Introduction

Lesson 01 Introduction

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

The Computer System. Hardware = Physical Computer. Software = Computer Programs. People = End Users & Programmers. people

Mobile Computing LECTURE # 2

COT 3530: Data Structures. Giri Narasimhan. ECS 389; Phone: x3748

What is Java Platform?

Object-Oriented Programming in Java

: the User (owner) for this file (your cruzid, when you do it) Position: directory flag. read Group.

J Automation objects and the corresponding Java support are only available in the Windows 95 and NT versions of J.

CS260 Intro to Java & Android 02.Java Technology

UNic Eclipse Mini Tutorial (Updated 06/09/2012) Prepared by Harald Gjermundrod

USING THE OOSIML/JAVA. With a Terminal Window

Chapter Two Bonus Lesson: JavaDoc

Terminology & Basic Concepts

Outline. Introduction to Java. What Is Java? History. Java 2 Platform. Java 2 Platform Standard Edition. Introduction Java 2 Platform

Slide 1 Java Programming 1 Lecture 2D Java Mechanics Duration: 00:01:06 Advance mode: Auto

Assignment Submission HOWTO

CS 220: Introduction to Parallel Computing. Beginning C. Lecture 2

GETTING STARTED. The longest journey begins with a single step. In this chapter, you will learn about: Compiling and Running a Java Program Page 2

Installation on a Macintosh

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

COMP6700/2140 JDK Tools

You should now start on Chapter 4. Chapter 4 introduces the following concepts

History Introduction to Java Characteristics of Java Data types

Exercise 1: Intro to Java & Eclipse

Lecture 02, Fall 2018 Friday September 7

13 th Windsor Regional Secondary School Computer Programming Competition

Introduction Basic elements of Java

Introduction to JAVA Programming Language

Getting Started (1.8.7) 9/2/2009

Introduction to Programming (Java) 2/12

Implementing a Web Server on OS/390: Part III Writing Common Gateway Interfaces and Installing Java Virtual Machine

CT 229. CT229 Lecture Notes. Labs. Tutorials. Lecture Notes. Programming II CT229. Objectives for CT229. IT Department NUI Galway

2 COMPUTER PROGRAMMING

II. Compiling and launching from Command-Line, IDE A simple JAVA program

Pace University. Fundamental Concepts of CS121 1

A sample algorithm to calculate someone s wages for the week might look like:

Special Edition Using Java Installing the JDK and Getting Started

Introduction to Java

Transcription:

IT151: Introduction to Programming (java)

Programming Basics Program A set of instructions that a computer uses to do something. Programming / Develop The act of creating or changing a program Programmer / Developer A person who makes a program Run / Execute The act of using a program Every program was created by someone Computers use special languages Programmers use special languages to create or change a program

Machine Language High Level Language C++ Java VB.NET Machine Language Hardware Machine language A language understood by computers When programs are run, machine language is used Machine languages are almost impossible for humans to understand Every operating system (OS) has its own machine language Windows Linux Macintosh

High Level Languages High Level Language C++ Java VB.NET Machine Language Hardware High Level Language - A programming language that is understandable by people This enables a programmer to write programs High level languages must be translated into machine language before running on a computer

Compilers and Interpreters There are two main ways to change programs written in a high level language to machine language: 1. Use a compiler 2. Use an interpreter Source Code Code written in a programming language by a developer.

Compilers Compiler A program that transforms code from one format to another High Level Language Machine Language Source code Windows compiler Windows code Windows Linux compiler Linux code Linux Macintosh compiler Macintosh code Macintosh

Compilers vs. Interpreters Advantages Programs run faster Disadvantages Platform dependent - Programs only work on a specific operating system. Windows Linux Macintosh Compiling a large program may take a long time

Interpreters Interpreter A program that translates and executes code Usually, interpreters translate and execute source code. Machine Language High Level Language Source Code Interpreter Code for Windows, Linux and Macintosh Windows, Linux and Macintosh

Interpreters vs. Compilers Advantages Platform Independent. Don t need to compile anything. Disadvantages The interpreter program must be installed on the computer that the program will run on Slower execution You should only use services available on all platforms. Example: Windows has a cool sound library, but you can t use it because it won t run on Macintosh

Introduction to Java Java is a programming language created by Sun Microsystems. Java.sun.com Many programmers use Java Java is an object oriented language.

Java Setup Steps to install Java Required 1. Install the Java Development Kit (JDK) Find it at http://java.sun.com. Java 2 Standard Edition Not Required but good 1. Install Java Documentation 2. Install Integrated Development Environment (IDE) IDE A program that helps you to write code

How Does Java Work? Java uses a compiler and interpreter! You can compile the program once and run it on each platform with an interpreter Source code Java Compiler Java Interpreter Windows Macintosh Windows Linux Byte Code Linux Macintosh

How to Create a Java Program 1. Create a source file. 2. Use the Java compiler to create byte code. 3. Run the byte code using the Java interpreter.

Create a Source File Write Java source code and save it in a file Use a text editor or Integrated Development Environment (IDE). Filename extension:.java

Use the Java Compiler to Create Byte Code Source code is compiled by a Java compiler to byte code. Byte Code A file that can run on any computer that has a Java Interpreter Filename extension:.class Compiler program: javac.exe Source Code Java Compiler void main ()?? this$0?!....java Javac.exe Byte Code.class

Use the Java Compiler to Create Byte Code Important Details Javac.exe <filename>.java Ex: Javac HelloWorld.java A.class file is made for every class in the file. Common Errors Unable to find the Compiler - Something is wrong with your Java setup. Windows can t find the Java compiler. Is your access to Javac.exe and Java.exe setup properly? Invalid Flag One of the inputs are wrong. Did you include the.java extension? Are you using the right file?

Run the Byte Code Using the Java Interpreter Java Virtual Machine (JVM) A program which interprets Java programs that have been compiled into byte-code and usually stored in a ".class" file. Interpreter performs actions Creates windows Prints Etc. Interpreter program: java.exe Byte Code?? this$0?!....class Java Interpreter Java.exe

Run the Byte Code Using the Java Interpreter Important Details Java.exe <class name> Ex: Java HelloWorld The class name must have the correct case! Common Errors NoClassDefFoundError The class can t be found. Is your class in the correct directory? Are you using the correct case?

Summary Source Code Extension used for Java source code files Byte code Convert source code into byte code Extension used for Java byte code? Run byte code? Purpose of main() method? Code comments.