Introduction to OOP with Java. Instructor: AbuKhleif, Mohammad Noor Sep 2017

Similar documents
Introduction. Introduction to OOP with Java. Lecture 01: Introduction to OOP with Java - AKF Sep AbuKhleiF -

Chapter 1 Introduction to Computers, Programs, and Java

Java Language. Programs. Computer programs, known as software, are instructions to the computer. You tell a computer what to do through programs.

Module 1: Introduction to Computers, Programs, and Java

Introduction to Java. Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.

Lecture 1: Introduction to Java

Chapter 1 Introduction to Computers, Programs, and Java

Chapter 1 Introduction to Java

Chapter 1: Introduction to Computers, Programs, and Java

OOP Part 2. Introduction to OOP with Java. Lecture 08: Introduction to OOP with Java - AKF Sep AbuKhleiF -

Lesson 01 Introduction

Introduction to OOP with Java. Instructor: AbuKhleif, Mohammad Noor Sep 2017

Chapter 1 Introduction to Computers, Programs, and Java

Introduction to OOP with Java. Instructor: AbuKhleif, Mohammad Noor Sep 2017

Chapter 1 Introduction to Computers, Programs, and Java

Chapter 1 Introduction to Computers, Programs, and Java

Chapter 1 Introduction to Computers, Programs, and Java

Eng. Mohammed S. Abdualal

Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer? A Bit of History

Getting Started with Java. Atul Prakash

Objectives. Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer?

Networks Programming Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000)

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

Getting Started. Chapter 1. Java Programming FROM THE BEGINNING. Chapter 1: Getting Started

Chapter 1 Introduction to Computers, Programs, and Java

Introduction to OOP with Java. Instructor: AbuKhleif, Mohammad Noor Sep 2017

Chapter 1 Introduction to Computers, Programs, and Java

Eng. Mohammed Alokshiya

Introduction to OOP Using Java Pearson Education, Inc. All rights reserved.

Introduction to Computers, Programs, and Java. CSE 114, Computer Science 1 Stony Brook University

CHAPTER 1 Introduction to Computers and Java

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

Arrays. Introduction to OOP with Java. Lecture 06: Introduction to OOP with Java - AKF Sep AbuKhleiF - 1

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

MEAP Edition Manning Early Access Program Get Programming with Java Version 1

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

Introduction Basic elements of Java

IQTIDAR ALI Lecturer IBMS Agriculture University Peshawar

Chapter 1: Introduction to Computers and Java

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

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

Programming: detailed instructions which tell the computer hardware what to do aka software Computer Science: the study NOT of computers, but of what

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

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

Introduction to Java Programming CPIT 202. WEWwwbvxnvbxmnhsgfkdjfcn

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

Lab # 2. For today s lab:

Introduction to JAVA Programming Language

CHAPTER 1. Introduction to JAVA Programming

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

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

For live Java EE training, please see training courses at

CMSC 150 LECTURE 1 INTRODUCTION TO COURSE COMPUTER SCIENCE HELLO WORLD

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

Java language. Part 1. Java fundamentals. Yevhen Berkunskyi, NUoS

Java Puzzle Ball Nick Ristuccia

Java Programming Fundamentals - Day Instructor: Jason Yoon Website:

Introduction to Java Programming

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

Lecture (01) Getting started. Dr. Ahmed ElShafee

Course Outline. Introduction to java

Elements of Computers and Programming Dr. William C. Bulko. What is a Computer?

Lecture Set 2: Starting Java

Chapter 1. Introduction

3 CREATING YOUR FIRST JAVA APPLICATION (USING WINDOWS)

Lecture Set 2: Starting Java

CHAPTER 1 INTRODUCTION TO COMPUTERS, PROGRAMS, AND JAVA. Objectives

CompSci 125 Lecture 02

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

Object-Oriented Programming in Java

Chapter 11 Program Development and Programming Languages

Java with Eclipse: Setup & Getting Started

AP Computer Science A: Java Programming

Chapter 2: Programming Concepts

Lecture 1 - Introduction (Class Notes)

Introduction Welcome! Before you start Course Assessments The course at a glance How to pass M257

Software and Programming 1

Setup and Getting Startedt Customized Java EE Training:

COMP-202: Foundations of Programming. Lecture 2: Java basics and our first Java program! Jackie Cheung, Winter 2016

Eclipse Tutorial. For Introduction to Java Programming By Y. Daniel Liang

NetBeans IDE Java Quick Start Tutorial

Lecture 4: Introduction to Java and your Development Environment

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

CSC116: Introduction to Computing - Java

Objects and Classes Lecture 1

Identifiers. Identifiers are the words a programmer uses in a program Some identifiers are already defined. Some are made up by the programmer:

C O M P U T A T I O N A L P H Y S I C S

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

Supplement D: Expanded Guidelines on Programming Style and Documentation

Computational Applications in Nuclear Astrophysics using Java Java course Lecture 1

Advanced Object-Oriented Programming Introduction to OOP and Java

CSC116: Introduction to Computing - Java

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

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

Chapter 3 Intro to Java

Expanded Guidelines on Programming Style and Documentation

Introduction to Software Development (ISD) David Weston and Igor Razgon

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

AP Computer Science A

Before you start working with Java, you need to set up a Java development

Transcription:

Introduction to OOP with Java Instructor: AbuKhleif, Mohammad Noor Sep 2017

Lecture 01: Introduction Instructor: AbuKhleif, Mohammad Noor Sep 2017

Instructor AbuKhleif, Mohammad Noor Studied Computer Engineer (JU 2012-2017) Works as a Software Automation Engineer @ Atypon John Wiley and Sons Company - Jordan Branch Reach me at: moh.noor94@gmail.com facebook.com/moh.noor94 twitter.com/moh_noor94 3

Course Java SE Basics Object Oriented Programming Course Page: /courses/java-101-sep-2017 Or, go to: Courses Java 101 Course Sep 2017 Course Facebook Group: www.facebook.com/groups/akf2017java 4

Let s Start! 5

Programs Computer programs, known as software, are instructions to the computer. You tell a computer what to do through programs. Without programs, a computer is an empty machine. Computers do not understand human languages, so you need to use computer languages to communicate with them. Programs are written using programming languages. 6

Programming Languages Machine Language Machine language is a set of primitive instructions built into every computer. The instructions are in the form of binary code, so you have to enter binary codes for various instructions. Program with native machine language is a tedious process. Moreover the programs are highly difficult to read and modify. For example, to add two numbers, you might write an instruction in binary like this: 1101101010011010 7

Programming Languages Assembly (Low Level) Language Assembly languages were developed to make programming easy. Since the computer cannot understand assembly language, however, a program called assembler is used to convert assembly language programs into machine code. For example, to add two numbers, you might write an instruction in assembly code like this: ADDF3 R1, R2, R3 8

Programming Languages High Level Languages The high-level languages are English-like and easy to learn and program. For example, the following is a high-level language statement that computes the area of a circle with radius 5: area = 5 * 5 * 3.1415; 9

POPULAR HIGH-LEVEL LANGUAGES 14.00% 12.00% Java, 12.69% 10.00% 8.00% C, 7.38% 6.00% 4.00% 2.00% C++, 5.57% C#, 4.78% Python, 2.98% PHP, 2.21% JavaScript, 2.02% Ruby, 1.93% Visual Basic.NET, 1.98% Perl, 1.95% Delphi/Object Pascal, 1.78% R, 1.82% Objective-C, 1.51% Assembly language, 1.64% Visual Basic, 1.75% Go, 1.57% Swift, 1.77% MATLAB, 1.63% PL/SQL, 1.48% 0.00% 10

Interpreting/Compiling Source Code A program written in a high-level language is called a source program or source code. Because a computer cannot understand a source program, a source program must be translated into machine code for execution. The translation can be done using another programming tool called an interpreter or a compiler. 11

Interpreting Source Code An interpreter reads one statement from the source code, translates it to the machine code or virtual machine code, and then executes it right away, as shown in the following figure: 12

Compiling Source Code A compiler translates the entire source code into a machine-code file, and the machine-code file is then executed, as shown in the following figure: 13

You paid for a Java course Why Java? It s the current hot language Java enables users to develop and deploy applications on the Internet for servers, desktop computers, and small hand-held devices It s platform independent this makes it great for Web programming It has a vast library of predefined objects and operations 14

Why Java? Java is a general purpose programming language. Java is the Internet programming language. It s almost entirely object-oriented It s more secure It isn t C++ 15

Why Java? Java Is Simple Java Is Object-Oriented Java Is Distributed Java Is Interpreted Java Is Secure Java Is Portable Please, read about Java characteristics here: www.cs.armstrong.edu/liang/javacharacteristics.pdf 16

Java Standard Edition (Java SE) Java Enterprise Edition (Java EE) Java Micro Edition (Java ME) to develop clientside standalone applications or applets. to develop server-side applications. to develop applications for mobile devices. Java Editions 17

JDK The Java Development Kit (JDK) consists of a set of separate programs, each invoked from command line, for developing and testing Java programs. Download Page: www.oracle.com/technetwork/java/javase/downloads/ jdk8-downloads-2133151.html 18

JDK Versions JDK 1.02 (1995) JDK 1.1 (1996) JDK 1.2 (1998) JDK 1.3 (2000) JDK 1.4 (2002) JDK 1.5 (2004) a. k. a. JDK 5 or Java 5 JDK 1.6 (2006) a. k. a. JDK 6 or Java 6 JDK 1.7 (2011) a. k. a. JDK 7 or Java 7 JDK 1.8 (2014) a. k. a. JDK 8 or Java 8 JDK 1.9 (Coming in 2017) a. k. a. JDK 9 or Java 9 19

IDE The Integrated Development Kit (IDE) provides graphical user interface to edit, compile, build, and debug programs. Popular Java IDEs: NetBeans (Open Source) Eclipse (Open Source) IntelliJ IDEA (Free and Enterprise Editions) 20

Download Page: jetbrains.com/idea/download/ Choose your OS (Windows?) Choose your version (Community?) Download! Want help? Please refer to this page: www.jetbrains.com/help/idea/installing-andlaunching.html Download IntelliJ IDEA 21

Welcome to Java // This program prints Welcome to Java! public class Welcome { public static void main(string[] args) { System.out.println("Welcome to Java!"); } } Java source programs are case sensitive. Every Java program must have at least one class. Each class has a name. By convention, class names start with an uppercase letter. The main method is the entry point where the program begins execution. A class may contain several methods. A method is a construct that contains statements. 22

Welcome to Java // This program prints Welcome to Java! public class Welcome { public static void main(string[] args) { System.out.println("Welcome to Java!"); } } A pair of curly braces { } in a program forms a block that groups the program s component. Every class has a class block that groups the data and methods of the class. Every method has a method block that groups the statements in the method. 23

Welcome to Java // This program prints Welcome to Java! public class Welcome { public static void main(string[] args) { System.out.println("Welcome to Java!"); } } The System.out.println statement displays the string Welcome to Java on the console. A String is a sequence of characters. Strings should be enclosed in double quotation marks. Every statement in Java ends with a semicolon (;). public, class, static, and void are reserved words : have a specific meaning to the compiler and cannot be used for other purposes. In the program. 24

Welcome to Java // This program prints Welcome to Java! public class Welcome { public static void main(string[] args) { System.out.println("Welcome to Java!"); } } Comments are ignored by the compiler. Two types of comments: Line comments: preceded by two slashes (//). Block (or paragraph) comments: enclosed between (/*) and (*/) Documentation comments: enclosed between (/**) and (*/) 25

Creating, Compiling, and Running Programs 26

Creating, Compiling, and Running Programs Java source code is compiled into Java bytecode Your Java code may use the code in the Java library The bytecode is similar to machine instructions, but is architecture neutral and can run on any platform that has a Java Virtual Machine (JVM) The JVM is an interpreter, which translates individual instructions in the bytecode into the target machine language code and executes it immediately. 27

Creating, Compiling, and Running Programs Practically, you can do this on your PC using: Any text editor to write and save your java file. DOS / Windows CMD / Linux Terminal / to compile and run your program. To do that, refer to these links: facweb.cs.depaul.edu/noriko/javasetup/ stackoverflow.com/a/26693191 But, believe me, you don't want this headache. Instead, let s use IntelliJ IDEA 28

Let s Code Write a Java program that print your name and age to the console. 29

References: - Liang, Introduction to Java Programming 10/e - Eng. Asma Abdel Karim Computer Engineering Department, JU Slides - www.tiobe.com/tiobe-index Instructor: AbuKhleif, Mohammad Noor Sep 2017 End of Lecture =D