Developed at Sun Microsystems in 1991 James Gosling, initially named “OAK” Formally announced java in 1995 Object oriented and cant write procedural.

Slides:



Advertisements
Similar presentations
Introduction to Computing Concepts Note Set 7. Overview Variables Data Types Basic Arithmetic Expressions ▫ Arithmetic.
Advertisements

Types, Variables and Operators Computer Engineering Department Java Course Asst. Prof. Dr. Ahmet Sayar Kocaeli University - Fall 2013.
Java Syntax Part I Comments Identifiers Primitive Data Types Assignment.
Shlomo Hershkop1 Introduction to java Class 1 Fall 2003 Shlomo Hershkop.
Declaring Variables You must first declare a variable before you can use it! Declaring involves: – Establishing the variable’s spot in memory – Specifying.
Outline Java program structure Basic program elements
Introduction to Java CS 331. Introduction Present the syntax of Java Introduce the Java API Demonstrate how to build –stand-alone Java programs –Java.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
Java: Chapter 1 Computer Systems Computer Programming II Aug
3.1 Documentation & Java Language Elements Purpose of documentation Assist the programmer with developing the program Assist other programers who.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
DAT602 Database Application Development Lecture 5 JAVA Review.
Java: Chapter 1 Computer Systems Computer Programming II.
INTRODUCTION TO JAVA CHAPTER 1 1. WHAT IS JAVA ? Java is a programming language and computing platform first released by Sun Microsystems in The.
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
The Java Programming Language
Lecture 2 Object Oriented Programming Basics of Java Language MBY.
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.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
 JAVA Compilation and Interpretation  JAVA Platform Independence  Building First JAVA Program  Escapes Sequences  Display text with printf  Data.
Chapter 2: Java Fundamentals
Primitive Variables.
Using Data Within a Program Chapter 2.  Classes  Methods  Statements  Modifiers  Identifiers.
An Introduction to Java – Part 1 Dylan Boltz. What is Java?  An object-oriented programming language  Developed and released by Sun in 1995  Designed.
Universidad Nacional de Colombia Facultad de Ingeniería Departamento de Sistemas ertificación en AVA.
Copyright Curt Hill Variables What are they? Why do we need them?
Applied Computing Technology Laboratory QuickStart Java Learning to Program in Java Dr. Tom Way October 21, 2005.
Getting Started Java Fundamentals CSC207 – Software Design Summer 2011 – University of Toronto – Department of Computer Science.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
CSCI 3133 Programming with C Instructor: Bindra Shrestha University of Houston – Clear Lake.
Variables and Constants Objectives F To understand Identifiers, Variables, and Constants.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Agenda Comments Identifiers Keywords Syntax and Symentics Indentation Variables Datatype Operator.
 Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. 
JAVA Programming (Session 2) “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 1: Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science.
Object Oriented Programming Lecture 2: BallWorld.
Introduction to Java Programming by Laurie Murphy Revised 09/08/2016.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
JAVA MULTIPLE CHOICE QUESTION.
Chapter No. : 1 Introduction to Java.
Chapter 2 Elementary Programming
Yanal Alahmad Java Workshop Yanal Alahmad
Lecture 2: Data Types, Variables, Operators, and Expressions
Internet and Java Foundations, Programming and Practice
University of Central Florida COP 3330 Object Oriented Programming
Data types and variables
Chapter 2.
Introduction to Programming in Java
Starting JavaProgramming
null, true, and false are also reserved.
مساق: خوارزميات ومبادئ البرمجة الفصل الدراسي الثاني 2016/2015
An Introduction to Java – Part I, language basics
Chapter 2 Edited by JJ Shepherd
Units with – James tedder
Units with – James tedder
Names of variables, functions, classes
C Language B. DHIVYA 17PCA140 II MCA.
Introduction to java Part I By Shenglan Zhang.
Variables and Constants
JAVA. Java is a high-level programming language originally developed by Sun Microsystems and released in Java runs on a variety of platforms, such.
Presentation transcript:

Developed at Sun Microsystems in 1991 James Gosling, initially named “OAK” Formally announced java in 1995 Object oriented and cant write procedural programs Functions are called methods Unit of a program is the class from which objects are created Automatic garbage collection Single inheritance only

Each class contains data and methods which are used to manipulate the data Programs are small and portable Multithreaded which allows several operations to be executed concurrently A rich set of classes and methods are available in java class libraries Platform Independent Case sensitive

Edit – use any editor Compile – use command ‘javac’if your program compiles correctly, will create a file with extension.class Execute – use the command ‘java’

Keywords are special reserved words in java that you cannot use as identifiers for classes, methods or variables. They have meaning to the compiler, it uses them to understand what your source code is trying to do.

class FirstPro { public static void main(String args[]) { System.out.println("Hello World!“); } First java Program

All java source files must end with the extension ‘.java’ Generally contain at most one top level public class definition If a public class is present, the class name should match the file name

If these are present then they must appear in the following order. Package declarations Import statements Class definitions

An identifier is a word used by a programmer to name a variable, method class or label. Keywords may not be used as an identifier Must begin with a letter, a dollar sign($) or an underscore( _ ). Subsequent character may be letters, digits, _ or $. Cannot include white spaces. ref: Note

Type identifier; Type identifier=initial value;

TypeBitsRange boolean1true, false char160 to 65,535 byte8-128 to +127 short16-32,768 to +32,767 int to long to float32-3.4E+38 to +3.4E+38 (approx) double64-1.8E+308 to +1.8E+308 (approx)

int grade; // an integer to hold a grade, no initial value int grade = 0; // an integer to hold a grade with initial value 0 char answer; // an answer to something – one character String name; // a string to hold a name String name = "Gumboot"; // as above, with an initial value boolean finished; // to hold "true" if finished boolean finished = false; // as above, but with an initial value

Declarations int grade; char answer; String name; Assignments grade = 70; answer = 'a'; name = "alan turing";

Data Type Default Value (for fields) byte0 short0 int0 long0L float0.0f double0.0d char'\u0000' String (or any object) String (or any object) null booleanfalse