Chapter 1 Primitive Java. import java.io.*; /* an example program */ public class Example1 { public static void main (String[] args) { System.out.println("Hello.

Slides:



Advertisements
Similar presentations
Continuation of chapter 6…. Nested while loop A while loop used within another while loop is called nested while loop. Q. An illustration to generate.
Advertisements

Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 3: Flow Control I: For Loops.
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Types, Variables and Operators Computer Engineering Department Java Course Asst. Prof. Dr. Ahmet Sayar Kocaeli University - Fall 2013.
Shlomo Hershkop1 Introduction to java Class 1 Fall 2003 Shlomo Hershkop.
CIS 234: Using Data in Java Thanks to Dr. Ralph D. Westfall.
CMT Programming Software Applications
Fundamental Programming Structures in Java: Comments, Data Types, Variables, Assignments, Operators.
Primitive Types Java supports two kinds of types of values – objects, and – values of primitive data types variables store – either references to objects.
Admin Office hours 2:45-3:15 today due to department meeting if you change addresses during the semester, please unsubscribe the old one from the.
Chapter 2: Basic Elements of Java J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
Chapter 3: Data Types and Operators JavaScript - Introductory.
Chapter 2 Basic Elements of Java. Chapter Objectives Become familiar with the basic components of a Java program, including methods, special symbols,
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
Geoff Holmes and Bernhard Pfahringer COMP206-08S General Programming 2.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
 JAVA Compilation and Interpretation  JAVA Platform Independence  Building First JAVA Program  Escapes Sequences  Display text with printf  Data.
Chapter 2: Java Fundamentals
Primitive Variables.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
Java Programming: From Problem Analysis to Program Design, 5e Chapter 2 Basic Elements of Java.
Objects, Classes and Syntax Dr. Andrew Wallace PhD BEng(hons) EurIng
College Board A.P. Computer Science A Topics Program Design - Read and understand a problem's description, purpose, and goals. Procedural Constructs.
An Introduction to Java – Part 1 Dylan Boltz. What is Java?  An object-oriented programming language  Developed and released by Sun in 1995  Designed.
1 Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
College Board A.P. Computer Science A Topics Program Design - Read and understand a problem's description, purpose, and goals. Procedural Constructs -
1 CS 007: Introduction to Computer Programming Ihsan Ayyub Qazi.
Java Expressions MIS 3023 Business Programming Concepts II The University of Tulsa Professor: Akhilesh Bajaj All slides in this presentation ©Akhilesh.
Primitive Variables.
Java Programming, Second Edition Chapter Two Using Data Within a Program.
Java Nuts and Bolts Variables and Data Types Operators Expressions Control Flow Statements Arrays and Strings.
1 Chapter 2: Java Fundamentals cont’d Spring Lory Al Moakar.
Developed at Sun Microsystems in 1991 James Gosling, initially named “OAK” Formally announced java in 1995 Object oriented and cant write procedural.
By Mr. Muhammad Pervez Akhtar
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Agenda Comments Identifiers Keywords Syntax and Symentics Indentation Variables Datatype Operator.
CSCI S-1 Section 4. Deadlines for Homework 2 Problems 1-8 in Parts C and D – Friday, July 3, 17:00 EST Parts E and F – Tuesday, July 7, 17:00 EST.
Computer Programming with Java Chapter 2 Primitive Types, Assignment, and Expressions.
Java Programming: From Problem Analysis to Program Design, Second Edition 1 Lecture 1 Objectives  Become familiar with the basic components of a Java.
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Java Programming: Guided Learning with Early Objects Chapter 1 Basic Elements of Java.
Elementary Programming
Yanal Alahmad Java Workshop Yanal Alahmad
Documentation Need to have documentation in all programs
Variables A variable is a placeholder for a value. It is a named memory location where that value is stored. Use the name of a variable to access or update.
Lecture 2: Data Types, Variables, Operators, and Expressions
Lecture Note Set 1 Thursday 12-May-05
Java Programming: From Problem Analysis to Program Design, 4e
Chapter 2.
Introduction to Programming in Java
Building Java Programs Chapter 2
Introduction to Java Programming
An Introduction to Java – Part I, language basics
Chapter 2: Basic Elements of Java
Chapter 2 Variables.
Chapter 2: Java Fundamentals
Chap 1 Chap 2 Chap 3 Chap 5 Surprise Me
elementary programming
Fundamental OOP Programming Structures in Java: Comments, Data Types, Variables, Assignments, Operators.
In this class, we will cover:
Names of variables, functions, classes
Chap 2. Identifiers, Keywords, and Types
Chapter 3 Introduction to Classes, Objects Methods and Strings
Introduction to java Part I By Shenglan Zhang.
Variables and Constants
Presentation transcript:

Chapter 1 Primitive Java

import java.io.*; /* an example program */ public class Example1 { public static void main (String[] args) { System.out.println("Hello World!"); }

Jargon and Syntax Review zclass - data fields and methods that describe the state and behavior of an object zmethod - a section of code that provides behavior for an object zcomments - notes to programmers that are ignored by the compiler. /* */ and //

Identifiers za name we make up zmust start with a letter zfollowed by any combination of letters, digits, and some “special” characters zcan not be a keyword zshould be meaningful

Primitive Types zbyte zshort zint zlong z float z double z char z boolean

Typed Constants zType determined by compiler

Reference Types zAll non-primitive types zstores a “reference” to a memory address where the object is located

Declarations int i; String s; long size = 5; String name = “George”;

OPERATORS assignment= compound assignment+= *= etc. binary arithmetic+ - / % unary++ -- binary relational== > = <= logical&& || !

Control Structures zSequence zSelection zRepetition

Some Loop Patterns zRead/process loop zSentinel controlled loop zCounted loop

Creating a Loop é Initialization é Termination é Body