Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

Introduction to Programming G51PRG University of Nottingham Revision 1
Object Oriented Programming in JAVA
1 Java Basics. 2 Compiling A “compiler” is a program that translates from one language to another Typically from easy-to-read to fast-to-run e.g. from.
Shlomo Hershkop1 Introduction to java Class 1 Fall 2003 Shlomo Hershkop.
Java Intro. A First Java Program //The Hello, World! program in Java public class Hello { public static void main(String[] args) { System.out.println("Hello,
Slide 1 of 40. Lecture A The Java Programming Language Invented 1995 by James Gosling at Sun Microsystems. Based on previous languages: C, C++, Objective-C,
Hello, world! Dissect HelloWorld.java Compile it Run it.
Introduction to Java.
Programming in Java; Instructor:Moorthy Introduction, Objects, Classes, Libraries1 Programming in Java Introduction.
“Introduction to Programming With Java”
Intro to Java Programming  A computer follows the instruction precisely and exactly.  Anything has to be declared and defined before it can be used.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
CS107 Introduction to Computer Science Java Basics.
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.)
Basic Java Programming CSCI 392 Week Two. Stuff that is the same as C++ for loops and while loops for (int i=0; i
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Introduction to Computer Systems and the Java Programming Language.
CS591x A very brief introduction to Java. Java Developed by Sun Microsystems was intended a language for embedded applications became a general purpose.
Basics of Java IMPORTANT: Read Chap 1-6 of How to think like a… Lecture 3.
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.
Lecture #5 Introduction to C++
Lecture 3 January 14, 2002 CSC Programming I Fall 2001.
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 Programming Java Java Basics. 2 Java Program Java Application Program Application Program written in general programming language Applet Program running.
Introduction to Java Java Translation Program Structure
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Applied Computing Technology Laboratory QuickStart Java Learning to Program in Java Dr. Tom Way October 21, 2005.
A Look at Java. Categorize Java Which paradigm? Which paradigm? Scripting? Scripting? Declarative or procedural? Declarative or procedural? Which generation?
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Overview of Java CSCI 392 Day One. Running C code vs Java code C Source Code C Compiler Object File (machine code) Library Files Linker Executable File.
Final Jeopardy Fundamen tal Java Numerical Data type Boolean Expressi on If/THEN/ WHILE Miscellan eous
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
CPS120: Introduction to Computer Science Variables and Constants.
Getting Started With Java September 22, Java Bytecode  Bytecode : is a highly optimized set of instructions designed to be executed by the Java.
Chapter One Lesson Three DATA TYPES ©
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Java Part I By Wen Fei, HAO. Program Structure public class ClassName { public static void main(String[] args) { program statements } user defined methods.
An Introduction to Java – Part 1 Erin Hamalainen CS 265 Sec 001 October 20, 2010.
COP 2551 Introduction to Object Oriented Programming with Java Topics –Introduction to the Java language –Code Commenting –Java Program Structure –Identifiers.
Java Computer Industry Lab. 1 Programming Java Java Basics Incheon Paik.
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
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.
CPSC 233 Tutorial January 21 st /22 nd, Linux Commands.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Introduction to java (class and object). Programming languages: –Easier to understand than CPU instructions –Needs to be translated for the CPU to understand.
Introduction of Java Fikri Fadlillah, S.T.
C++ Lesson 1.
JAVA MULTIPLE CHOICE QUESTION.
Intro to ETEC Java.
GC101 Introduction to computer and program
Chapter No. : 1 Introduction to Java.
Internet and Java Foundations, Programming and Practice
Java package classes Java package classes.
Programming Language Concepts (CIS 635)
Chapter 2.
Principles of Computer Programming (using Java) Chapter 2, Part 1
An Introduction to Java – Part I, language basics
Chapter 2: Java Fundamentals
Java Intro.
Chap 1 Chap 2 Chap 3 Chap 5 Surprise Me
Unit 3: Variables in Java
Introduction to java Part I By Shenglan Zhang.
Presentation transcript:

Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee

Introduction to JAVA High Level Programming Language (HLL) Java, released in 1995, is a relatively new programming language. Developed by James Gosling from Sun Microsystems and his team

Creating a Java Program javac.java java.class

Java Program: a set of instructions for the computer to follow. The source code. Saved as filename.java Data: data for the Java program Java Compiler (javac): translates the program from Java to a language that the computer can understand. Byte Code Program: the compiler translates Java into a language called byte-code. Byte code is the machine language for Java Virtual Machine (JVM). filename.class Byte Code Interpreter (java): the interpreter (JVM) translates byte code into machine language (.exe) Machine Language: is the la nguage the computer understands.

Parts of a Java Program import java.io.*; public class Hello { public static void main (String[ ] args) { System.out.println(“Hello."); System.out.print(“Welcome to Java Programming!"); } } This is same as header file in C. This package is used for input and output.

Parts of a Java Program import java.io.*; public class Hello { public static void main (String[ ] args) { System.out.println(“Hello."); System.out.print(“Welcome to Java Programming!"); } } Every Java program is a class. The program starts with the name of the class. The class name must be the same as the. java file you save.

Parts of a Java Program import java.io.*; public class Hello { public static void main (String[ ] args) { System.out.println(“Hello."); System.out.print(“Welcome to Java Programming!"); } } A main method is needed for execution to start. This main method gets executed first. The array of strings parameter is must.

Parts of a Java Program import java.io.*; public class Hello { public static void main (String[ ] args) { System.out.println(“Hello."); System.out.print(“Welcome to Java Programming!"); } } Output statements: the basic output statement in Java is the System.out.println( ) or System.out.print( )

Variables Most Often Used Data Type Keyword Kind of Value Bytes of Memory Range of Values Character char 1 character2 not applicable Bytebyteinteger to127 Short integer short Integers 2 -32,768 to 32,767 (-2 15 to ) Integer int Integers4 -2,147,483,648 to 2,147,483,647 (-2 31 to ) Long Integer long Integers to (-2 63 to ) Floatfloat Decimal values to 7 decimal digit precision 4 3.4e-38 to 3.4e38 positive and negative DoubledoubleDecimal values to 15 decimal digit precision 8 1.7e-308 to 1.73e308 positive and negative Boolean bool Boolean (Logical) values True or False 1not applicable

Constant Variables Constant is a variable whose value does not change in the program. Eg: PI = 3.14 The keyword ‘final’ is used to define constant in Java Eg. final int count = 100; final double PI=3.14;