Chapter 1 Fundamentals of Java Programming

Similar documents
Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.

Glossary of Object Oriented Terms

Fundamentals of Java Programming

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

Compiling Object Oriented Languages. What is an Object-Oriented Programming Language? Implementation: Dynamic Binding

Java Programming. Binnur Kurt Istanbul Technical University Computer Engineering Department. Java Programming. Version 0.0.

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.

Agent Languages. Overview. Requirements. Java. Tcl/Tk. Telescript. Evaluation. Artificial Intelligence Intelligent Agents

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

1001ICT Introduction To Programming Lecture Notes

Computing Concepts with Java Essentials

Introduction to Java Applications Pearson Education, Inc. All rights reserved.

Course MS10975A Introduction to Programming. Length: 5 Days

Chapter 3: Operating-System Structures. Common System Components

#820 Computer Programming 1A

1. Overview of the Java Language

Java Interview Questions and Answers

Habanero Extreme Scale Software Research Project

CHAPTER 1 ENGINEERING PROBLEM SOLVING. Copyright 2013 Pearson Education, Inc.

C++ INTERVIEW QUESTIONS

The Java Series. Java Essentials I What is Java? Basic Language Constructs. Java Essentials I. What is Java?. Basic Language Constructs Slide 1

Chapter 1. Introduction to Computers, Programs, and Java

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

AP Computer Science A - Syllabus Overview of AP Computer Science A Computer Facilities

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

2 Introduction to Java. Introduction to Programming 1 1

DIPLOMADO DE JAVA - OCA

core. Volume I - Fundamentals Seventh Edition Sun Microsystems Press A Prentice Hall Title ULB Darmstadt

System Requirements Table of contents

Effective Java Programming. efficient software development

CS 209 Programming in Java #1

Java Programming Fundamentals

Programmation 2. Introduction à la programmation Java

Introduction to programming

Lesson 06: Basics of Software Development (W02D2

Chapter 1 Introduction to Computers, Programs, and Java

Object-Oriented Programming Lecture 2: Classes and Objects

Structural Design Patterns Used in Data Structures Implementation

Comp 411 Principles of Programming Languages Lecture 34 Semantics of OO Languages. Corky Cartwright Swarat Chaudhuri November 30, 20111

Course Title: Software Development

Computer Literacy. Hardware & Software Classification

Exception Handling. Overloaded methods Interfaces Inheritance hierarchies Constructors. OOP: Exception Handling 1

Python Programming: An Introduction to Computer Science

TYLER JUNIOR COLLEGE School of Continuing Studies 1530 SSW Loop 323 Tyler, TX

Web Development in Java

Checking Access to Protected Members in the Java Virtual Machine

Java Application Developer Certificate Program Competencies

Java and Real Time Storage Applications

Crash Course in Java

Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Developing Embedded Software in Java Part 1: Technology and Architecture

Can You Trust Your JVM Diagnostic Tools?

SE 360 Advances in Software Development Object Oriented Development in Java. Polymorphism. Dr. Senem Kumova Metin

How To Write A Program In Java (Programming) On A Microsoft Macbook Or Ipad (For Pc) Or Ipa (For Mac) (For Microsoft) (Programmer) (Or Mac) Or Macbook (For

An Overview of Java. overview-1

Introduction to Java

No no-argument constructor. No default constructor found

Chapter 12 Programming Concepts and Languages

INTRODUCTION TO JAVA PROGRAMMING LANGUAGE

TECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction

CS 111 Classes I 1. Software Organization View to this point:

Java EE Web Development Course Program

Part I. Multiple Choice Questions (2 points each):

Reducing Transfer Delay Using Java Class File Splitting and Prefetching

Java in Education. Choosing appropriate tool for creating multimedia is the first step in multimedia design

Computer Programming I & II*

CS 170 Java Programming 1. Welcome to CS 170. All about CS 170 The CS 170 Online Materials Java Mechanics: Your First Program

Android Application Development Course Program

Objectives. Python Programming: An Introduction to Computer Science. Lab 01. What we ll learn in this class

CSE 452: Programming Languages. Acknowledgements. Contents. Java and its Evolution

Chapter 6: Programming Languages

Programming and Software Development CTAG Alignments

Software: Systems and Application Software

Java SE 8 Programming

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Introduction to Object-Oriented Programming

History OOP languages Year Language 1967 Simula Smalltalk

Lecture 1 Introduction to Android

Stack Allocation. Run-Time Data Structures. Static Structures

Python Programming: An Introduction to Computer Science

Contents. Java - An Introduction. Java Milestones. Java and its Evolution

Introduction to Computers and C++ Programming

CACHÉ: FLEXIBLE, HIGH-PERFORMANCE PERSISTENCE FOR JAVA APPLICATIONS

CS506 Web Design and Development Solved Online Quiz No. 01

Introduction to Object-Oriented Programming

OKLAHOMA SUBJECT AREA TESTS (OSAT )

Schema Classes. Polyhedra Ltd

El Dorado Union High School District Educational Services

INTRODUCTION TO OBJECTIVE-C CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 12 09/29/2011

Java (12 Weeks) Introduction to Java Programming Language

Java Virtual Machine: the key for accurated memory prefetching

Configuration Management

Moving from CS 61A Scheme to CS 61B Java

Enterprise Java. Where, How, When (and When Not) to Apply Java in Client/Server Business Environments. Jeffrey Savit Sean Wilcox Bhuvana Jayaraman

Transcription:

Chapter 1 Fundamentals of Java Programming

Computers and Computer Programming Writing and Executing a Java Program Elements of a Java Program Features of Java Accessing the Classes and Class Members The Memory Usage by a Java Program When Will the Error Occur?

Understand how computers and computer programs work. Understand how a Java program is written, compiled, and executed. Understand what makes Java platform independent. Identify the object-oriented features of Java. Identify different elements of a Java program: primitive variable, reference variable, local variable, instance variable, method, and class.

Identify where in memory the method invocations, objects, and variables are stored. Understand how access modifiers define the accessibility of classes and class members. Understand the concepts of early binding and late binding in the context of program errors.

How a Computer Works How a Computer Program Works

From a computer program s perspective, a computer consists of components to do the following: Receive data from a user Process the data according to instructions from a program or a user Place the results somewhere

Places to Store Data: Permanent storage: hard drive Temporary storage: RAM I/O Devices: monitor, keyboard, disk, and printer CPU: The Brain of the Computer

Computers and Computer Programming Writing and Executing a Java Program Elements of a Java Program Features of Java Accessing the Classes and Class Members The Memory Usage by a Java Program When Will the Error Occur?

A compiler translates a program in C/C++ to a binary format called executable code The executable code is machine dependent Java programs are machine independent, thanks to Java virtual machine (JVM).

Writing a Java Program Compiling a Java Program Executing a Java Program

Source code: a set of instructions in text format written according to the rules of the Java programming language. Source file: contains these instructions, and has the file extension.java

Machine language: a binary format In Java, the compiler compiles the source code into bytecode To create the bytecode files (.class) from the source file RobotManager.java: javac RobotManager.java

Executing a Java program by issuing the java command: java RobotManager Ginny 420 The JVM reads the bytecode file and translates the instructions to the executable format that your computer can understand

Computers and Computer Programming Writing and Executing a Java Program Elements of a Java Program Features of Java Accessing the Classes and Class Members The Memory Usage by a Java Program When Will the Error Occur?

Classes and Objects Methods Variables and Data Types Execution Flow of a Program

A class is a template (or a blueprint) from which objects are created Writing a class is called implementing a class: declaration & body An object is instantiated from a class, and also called the instance of that class Each object has a state, a set of characteristics, and a behavior represented by methods

The state of an object is represented by a set of data items that are handled by using variables The variable s type determines what kind of values it can hold The declaration of a variable: <type> <name>; An object reference variable refer to an object: Robot robot;

Expressions: combination of variables, operators, literals, and method calls Statements: a complete execution unit of a program; contain one or more expressions Blocks: a group of zero or more statements between an opening brace and a closing brace Execution Flow Control: skip, execute, or repeatedly execute a block of statements

Computers and Computer Programming Writing and Executing a Java Program Elements of a Java Program Features of Java Accessing the Classes and Class Members The Memory Usage by a Java Program When Will the Error Occur?

Platform Independence Object-Oriented Programming

write once, run anywhere. The Java compiler compiles the source code into bytecode, which can be interpreted by a suitable JVM on any platform The JVM can prevent the code from generating side effects outside the system.

Encapsulation: combining an object s data with its methods Inheritance: Code reusability Code maintenance Implementing OOP Polymorphism: allows an object of a superclass to refer to an object of any subclass.

Computers and Computer Programming Writing and Executing a Java Program Elements of a Java Program Features of Java Accessing the Classes and Class Members The Memory Usage by a Java Program When Will the Error Occur?

Class members: variables, methods, and nested classes. Access modifiers: control the access to the class members public protected default private

Computers and Computer Programming Writing and Executing a Java Program Elements of a Java Program Features of Java Accessing the Classes and Class Members The Memory Usage by a Java Program When Will the Error Occur?

Computers and Computer Programming Writing and Executing a Java Program Elements of a Java Program Features of Java Accessing the Classes and Class Members The Memory Usage by a Java Program When Will the Error Occur?

Compilation fails An exception is thrown at runtime