SlideShare a Scribd company logo
1 of 17
Download to read offline
Lesson1: JAVA


Computer Fundamentals I




  INTRODUCTION TO JAVA PROGRAMMING
HARDWARE AND SOFTWARE




       INTRODUCTION TO JAVA PROGRAMMING
What is Programming Language
• High Level Language & Low Level
  Language

C++, C, FORTRAN, PASCAL
Assembly Language or Machine Language
• High Level Language Better or Low Level
  Language.


              INTRODUCTION TO JAVA PROGRAMMING
Programming languages: A Review
•   FORTRAN                      •   Ada
•   COBOL                        •   SQL
•   BASIC                        •   Lisp
•   Z80 assembler                •   Prolog
•   IBM 360 assembler            •   Eiffel
•   PL1                          •   HTML
•   SL1                          •   JavaScript
•   C                            •   Java
•   Pascal                       •   Jess
•   SNOBOL

                 INTRODUCTION TO JAVA PROGRAMMING
Discussion Points
• Different levels: high - low
• Different implementations: interpreted, compiled
• Different paradigms: procedural, declarative,
   object oriented
• Different target domains: data processing,
   scientific, database manipulation, string
   manipulation, logic, general purpose …
• Different ages: modern/ old fashioned; longevity
• Different language features/ constructs


                  INTRODUCTION TO JAVA PROGRAMMING
Common Grounds
• Handle data: variables
• Handle flow of control:
– sequence, selection, iteration
• Shared code: sub routines
• Data structures: arrays
• File handling


               INTRODUCTION TO JAVA PROGRAMMING
Interpreting and Compiling




NOTE : JAVA do both, Interpreting and Compiling
                        INTRODUCTION TO JAVA PROGRAMMING
How JAVA Works




Portability can be Achieved this Way




                  INTRODUCTION TO JAVA PROGRAMMING
Why JAVA
• Simple and clean
• Object oriented
• Portable/ platform independent
• Robust
• Secure
• Multi-threaded
• Dynamic
• ++

               INTRODUCTION TO JAVA PROGRAMMING
Program
• A program is a sequence of instructions that specifies
  how to perform a computation.
BASIC Operations in Program:
• Input
• Output
• Mathematical Operations
• Testing
• Repetition
  “Programming can also be described as the process of
  breaking a large, complex task up into smaller and smaller
  subtasks until eventually the subtasks are simple enough to
  be performed with one of these basic operations.”


                     INTRODUCTION TO JAVA PROGRAMMING
Debugging
• Bugs and Errors
• Types of Errors
               Compile Time Errors
               Run Time Errors
               Logic and Semantic Error
• Experimental Debugging


              INTRODUCTION TO JAVA PROGRAMMING
A First Program
• Print “Hello World” to the console
/*
* HelloWorld.java
*
* Created on 19 Sep 2010, 17:56
*/
        class HelloWorld {
               public static void main (String args[]) {
               System.out.println("Hello World!");
                                                       }
                           }

                      INTRODUCTION TO JAVA PROGRAMMING
First Steps...
• A Java application is made up of a
   collection of classes
• Normally, one (& only one) of these classes
   should have a method called main
• Console output can be achieved using:
               System.out.print(“a string”);
               or
               Err     or
                       println
                                    or a
                                    variable

                     INTRODUCTION TO JAVA PROGRAMMING
Compiling First Program
• The file name of this program is:
            HelloWorld.java
• To compile the program, type:
            javac HelloWorld.java
• To run the program, type:
            java HelloWorld
• Output should be:
            Hello World!

                INTRODUCTION TO JAVA PROGRAMMING
The JAVA Virtual Machine
• Java is compiled into an intermediate form
  (bytecode)
• These are the .class files produced by javac
• The bytecode is interpreted at runtime by
  the Java Virtual Machine
• Java compiled on one machine (type) can be
  executed on another (type)

                INTRODUCTION TO JAVA PROGRAMMING
Standard Java Tools (Java 2 SDK)
• javac - the compiler
• java - the launcher for Java apps
• javadoc - API documentation generator
• appletviewer - run & debug applets without
   a browser
• jar - manage Java Archive (JAR) files
• jdb - Java debugger
• javap - class file dis assembler
• ++

               INTRODUCTION TO JAVA PROGRAMMING
JDK Kits and Editors
• J2SE Available on Sun Website
• Editors: Stick with javac, java & your
  chosen editor (PFE, notepad, JCreator, …)
• Java Keywords: 48 reserved Keyword in
  Java Language.
List can be checked at
  http://java.sun.com/docs/books/jls/second_e
  dition/html/lexical.doc.html

               INTRODUCTION TO JAVA PROGRAMMING

More Related Content

What's hot (19)

Why JVM will outlive java?
Why JVM will outlive java?Why JVM will outlive java?
Why JVM will outlive java?
 
The Real Thing: Java Virtual Machine
The Real Thing: Java Virtual MachineThe Real Thing: Java Virtual Machine
The Real Thing: Java Virtual Machine
 
Java Virtual Machine
Java Virtual Machine Java Virtual Machine
Java Virtual Machine
 
Java introduction
Java introductionJava introduction
Java introduction
 
JDK,JRE,JVM
JDK,JRE,JVMJDK,JRE,JVM
JDK,JRE,JVM
 
QSpiders - Jdk Jvm Jre and Jit
QSpiders - Jdk Jvm Jre and JitQSpiders - Jdk Jvm Jre and Jit
QSpiders - Jdk Jvm Jre and Jit
 
History of java'
History of java'History of java'
History of java'
 
Java
JavaJava
Java
 
Core java environment setup and details
Core java environment setup and detailsCore java environment setup and details
Core java environment setup and details
 
Jvm
JvmJvm
Jvm
 
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVMJava Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
 
A tour of Java and the JVM
A tour of Java and the JVMA tour of Java and the JVM
A tour of Java and the JVM
 
Java introduction with JVM architecture
Java introduction with JVM architectureJava introduction with JVM architecture
Java introduction with JVM architecture
 
History of Java 1/2
History of Java 1/2History of Java 1/2
History of Java 1/2
 
Advanced JavaScript techniques
Advanced JavaScript techniquesAdvanced JavaScript techniques
Advanced JavaScript techniques
 
Inside the jvm
Inside the jvmInside the jvm
Inside the jvm
 
Java byte code presentation
Java byte code presentationJava byte code presentation
Java byte code presentation
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
 

Viewers also liked

Project in science 6 chmsc lab. school
Project in science 6 chmsc lab. schoolProject in science 6 chmsc lab. school
Project in science 6 chmsc lab. schoolRicci Fernandez
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaattiqrocket
 
Ansn ind 14_ir_suyamto
Ansn ind 14_ir_suyamtoAnsn ind 14_ir_suyamto
Ansn ind 14_ir_suyamtolukmanft21
 
Anglo Presentation 2012
Anglo Presentation 2012Anglo Presentation 2012
Anglo Presentation 2012Sophie Sauze
 
Cara menginstal windows xp
Cara menginstal windows xpCara menginstal windows xp
Cara menginstal windows xpcorrynatalia
 
Trước và sau niềng răng tại nha khoa ocare
Trước và sau niềng răng tại nha khoa ocareTrước và sau niềng răng tại nha khoa ocare
Trước và sau niềng răng tại nha khoa ocareNgọc Hà
 
Anatomi organ reproduksi ternak jantan
Anatomi organ reproduksi ternak jantanAnatomi organ reproduksi ternak jantan
Anatomi organ reproduksi ternak jantanJuaini Suhardani
 

Viewers also liked (13)

Invitacion a mi Barbacoa
Invitacion a mi BarbacoaInvitacion a mi Barbacoa
Invitacion a mi Barbacoa
 
Project in science 6 chmsc lab. school
Project in science 6 chmsc lab. schoolProject in science 6 chmsc lab. school
Project in science 6 chmsc lab. school
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Geopolitica
GeopoliticaGeopolitica
Geopolitica
 
S & g
S & gS & g
S & g
 
Ansn ind 14_ir_suyamto
Ansn ind 14_ir_suyamtoAnsn ind 14_ir_suyamto
Ansn ind 14_ir_suyamto
 
Anglo Presentation 2012
Anglo Presentation 2012Anglo Presentation 2012
Anglo Presentation 2012
 
Lesson1 intro
Lesson1 introLesson1 intro
Lesson1 intro
 
Cara menginstal windows xp
Cara menginstal windows xpCara menginstal windows xp
Cara menginstal windows xp
 
Que es un proyecto
Que es un proyectoQue es un proyecto
Que es un proyecto
 
Trước và sau niềng răng tại nha khoa ocare
Trước và sau niềng răng tại nha khoa ocareTrước và sau niềng răng tại nha khoa ocare
Trước và sau niềng răng tại nha khoa ocare
 
Anatomi organ reproduksi ternak jantan
Anatomi organ reproduksi ternak jantanAnatomi organ reproduksi ternak jantan
Anatomi organ reproduksi ternak jantan
 
Ppt form 1
Ppt form 1Ppt form 1
Ppt form 1
 

Similar to Lesson1 intro

Similar to Lesson1 intro (20)

basic core java up to operator
basic core java up to operatorbasic core java up to operator
basic core java up to operator
 
1.Intro--Why Java.pptx
1.Intro--Why Java.pptx1.Intro--Why Java.pptx
1.Intro--Why Java.pptx
 
Basic javaprogramming(session1)
Basic javaprogramming(session1)Basic javaprogramming(session1)
Basic javaprogramming(session1)
 
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptxJAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
 
1 java programming- introduction
1  java programming- introduction1  java programming- introduction
1 java programming- introduction
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
1 java introduction
1 java introduction1 java introduction
1 java introduction
 
1 java intro
1 java intro1 java intro
1 java intro
 
Lecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 FastLecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 Fast
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
 
1 Module 1 Introduction.pptx
1 Module 1 Introduction.pptx1 Module 1 Introduction.pptx
1 Module 1 Introduction.pptx
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
 
JavaClassPresentation
JavaClassPresentationJavaClassPresentation
JavaClassPresentation
 
JAVA INTRODUCTION
JAVA INTRODUCTIONJAVA INTRODUCTION
JAVA INTRODUCTION
 
Skillwise Elementary Java Programming
Skillwise Elementary Java ProgrammingSkillwise Elementary Java Programming
Skillwise Elementary Java Programming
 
OOP Lecture 1-Intro to Java.pptx
OOP Lecture 1-Intro to Java.pptxOOP Lecture 1-Intro to Java.pptx
OOP Lecture 1-Intro to Java.pptx
 
Java introduction
Java introductionJava introduction
Java introduction
 
Interpreters & Debuggers
Interpreters  &  DebuggersInterpreters  &  Debuggers
Interpreters & Debuggers
 
Chapter-1 Introduction.pptx
Chapter-1 Introduction.pptxChapter-1 Introduction.pptx
Chapter-1 Introduction.pptx
 

Lesson1 intro

  • 1. Lesson1: JAVA Computer Fundamentals I INTRODUCTION TO JAVA PROGRAMMING
  • 2. HARDWARE AND SOFTWARE INTRODUCTION TO JAVA PROGRAMMING
  • 3. What is Programming Language • High Level Language & Low Level Language C++, C, FORTRAN, PASCAL Assembly Language or Machine Language • High Level Language Better or Low Level Language. INTRODUCTION TO JAVA PROGRAMMING
  • 4. Programming languages: A Review • FORTRAN • Ada • COBOL • SQL • BASIC • Lisp • Z80 assembler • Prolog • IBM 360 assembler • Eiffel • PL1 • HTML • SL1 • JavaScript • C • Java • Pascal • Jess • SNOBOL INTRODUCTION TO JAVA PROGRAMMING
  • 5. Discussion Points • Different levels: high - low • Different implementations: interpreted, compiled • Different paradigms: procedural, declarative, object oriented • Different target domains: data processing, scientific, database manipulation, string manipulation, logic, general purpose … • Different ages: modern/ old fashioned; longevity • Different language features/ constructs INTRODUCTION TO JAVA PROGRAMMING
  • 6. Common Grounds • Handle data: variables • Handle flow of control: – sequence, selection, iteration • Shared code: sub routines • Data structures: arrays • File handling INTRODUCTION TO JAVA PROGRAMMING
  • 7. Interpreting and Compiling NOTE : JAVA do both, Interpreting and Compiling INTRODUCTION TO JAVA PROGRAMMING
  • 8. How JAVA Works Portability can be Achieved this Way INTRODUCTION TO JAVA PROGRAMMING
  • 9. Why JAVA • Simple and clean • Object oriented • Portable/ platform independent • Robust • Secure • Multi-threaded • Dynamic • ++ INTRODUCTION TO JAVA PROGRAMMING
  • 10. Program • A program is a sequence of instructions that specifies how to perform a computation. BASIC Operations in Program: • Input • Output • Mathematical Operations • Testing • Repetition “Programming can also be described as the process of breaking a large, complex task up into smaller and smaller subtasks until eventually the subtasks are simple enough to be performed with one of these basic operations.” INTRODUCTION TO JAVA PROGRAMMING
  • 11. Debugging • Bugs and Errors • Types of Errors Compile Time Errors Run Time Errors Logic and Semantic Error • Experimental Debugging INTRODUCTION TO JAVA PROGRAMMING
  • 12. A First Program • Print “Hello World” to the console /* * HelloWorld.java * * Created on 19 Sep 2010, 17:56 */ class HelloWorld { public static void main (String args[]) { System.out.println("Hello World!"); } } INTRODUCTION TO JAVA PROGRAMMING
  • 13. First Steps... • A Java application is made up of a collection of classes • Normally, one (& only one) of these classes should have a method called main • Console output can be achieved using: System.out.print(“a string”); or Err or println or a variable INTRODUCTION TO JAVA PROGRAMMING
  • 14. Compiling First Program • The file name of this program is: HelloWorld.java • To compile the program, type: javac HelloWorld.java • To run the program, type: java HelloWorld • Output should be: Hello World! INTRODUCTION TO JAVA PROGRAMMING
  • 15. The JAVA Virtual Machine • Java is compiled into an intermediate form (bytecode) • These are the .class files produced by javac • The bytecode is interpreted at runtime by the Java Virtual Machine • Java compiled on one machine (type) can be executed on another (type) INTRODUCTION TO JAVA PROGRAMMING
  • 16. Standard Java Tools (Java 2 SDK) • javac - the compiler • java - the launcher for Java apps • javadoc - API documentation generator • appletviewer - run & debug applets without a browser • jar - manage Java Archive (JAR) files • jdb - Java debugger • javap - class file dis assembler • ++ INTRODUCTION TO JAVA PROGRAMMING
  • 17. JDK Kits and Editors • J2SE Available on Sun Website • Editors: Stick with javac, java & your chosen editor (PFE, notepad, JCreator, …) • Java Keywords: 48 reserved Keyword in Java Language. List can be checked at http://java.sun.com/docs/books/jls/second_e dition/html/lexical.doc.html INTRODUCTION TO JAVA PROGRAMMING