SlideShare a Scribd company logo
1 of 29
Computer Programming
                            Chapter 1 : Introduction


                  Atit Patumvan
  Faculty of Management and Information Sciences
                Naresuan University
2



                                                                What is Programming?


                         •        Computers are programmed to perform tasks

                         •        Different tasks = different programs

                         •        Program

                                •         Sequence of basic operations executed in
                                          succession

                                •         Contains instruction sequences for all tasks it can
                                          execute

                         •        Sophisticated programs require teams of highly
                                  skilled programmers and other professionals



Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University     Computer Programming, Chapter 1 : Introduction
3



                                                                             History Timeline




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University              Computer Programming, Chapter 1 : Introduction
4



                             The Evolution of Programming Languages


                         •        To build programs, people use languages that are
                                  similar to human language. The results are
                                  translated into machine code, which computers
                                  understand.

                         •        Programming languages fall into three broad
                                  categories:

                                •         Machine languages

                                •         Assembly languages

                                •         Higher-level



Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University   Computer Programming, Chapter 1 : Introduction
5



                                                                   Assembly Languages


                         •        Assembly languages (second-generation
                                  languages) are only somewhat easier to work with
                                  than machine languages.

                         •        To create programs in assembly language,
                                  developers use cryptic English-like phrases to
                                  represent strings of numbers.

                         •        The code is then translated into object code, using a
                                  translator called an assembler.




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University      Computer Programming, Chapter 1 : Introduction
6



                                                      Assembly Languages


                                                                   Assembly Code




                                                                                     Assembler



                                                                                      Assembly Code




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University     Computer Programming, Chapter 1 : Introduction
7



                                                              Higher-Level Languages


                         •        Higher-level languages are more powerful than
                                  assembly language and allow the programmer to
                                  work in a more English-like environment.

                         •        Higher-level programming languages are divided
                                  into three "generations," each more powerful than
                                  the last:

                                •         Third-generation languages

                                •         Fourth-generation languages

                                •         Fifth-generation languages



Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University     Computer Programming, Chapter 1 : Introduction
8



                                                        Third-generation languages


                         •        Third-generation languages (3GLs) are the first to
                                  use true English-like phrasing, making them easier
                                  to ! use than previous languages.

                         •        3GLs are portable, meaning the object code created
                                  for one type of system can be translated for use on
                                  a different type of system.

                         •        The following languages are 3GLs

                                    FORTAN                                           BASIC    PHP
                                    C                                                Java     JavaScript
                                    COBOL                                            Pascal   Ruby
                                    C++                                              C#       Python

Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University                  Computer Programming, Chapter 1 : Introduction
9



                       A Typical Program Development Environment


                                      Edit                              Program is created in the editor and stored on disk


                             Preprocess                                          Preprocessor program processes the code


                                 Compile                                Compiler creates object code and stores it on disk.


                                     Link                                      Linker links the object code with the libraries


                                    Load                                              Loader puts program in memory


                                 Execute                                         CPU takes each instruction and executes it



Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University                                      Computer Programming, Chapter 1 : Introduction
10



                                                   Fourth-Generation Languages


                         •        Fourth-generation languages (4GLs) are even
                                  easier to use than 3GLs.

                         •        4GLs may use a text-based environment (like a
                                  3GL) or may allow the programmer to work in a
                                  visual environment, using graphical tools.

                         •        The following languages are 4GLs:

                                    Visual Basic
                                    Magic




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University   Computer Programming, Chapter 1 : Introduction
11



                                                       Fifth-Generation Languages



                         •        Fifth-generation languages (5GLs) are an issue of
                                  debate in the programming community – some
                                  programmers !cannot agree that they even exist.

                         •        These high-level languages would use artificial
                                  intelligence to create software, making 5GLs
                                  extremely difficult to develop.

                         •        Solve problems using constraints rather than
                                  algorithms, used in Artificial Intelligence
                                    Prolog
                                    CLIPs

Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University   Computer Programming, Chapter 1 : Introduction
12



                                                            History of Java Language

                         •       JDK 1.0 (January 23, 1996)                          •   Java SE 7 (July 7, 2011)


                         •       JDK 1.1 (February 19, 1997)                         •   Java SE 8 (expected in summer
                                                                                         2013)
                         •       J2SE 1.2 (December 8, 1998)


                         •       J2SE 1.3 (May 8, 2000)


                         •       J2SE 1.4 (February 6, 2002)


                         •       J2SE 5.0 (September 30, 2004)


                         •       Java SE 6 (December 11, 2006)




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University                         Computer Programming, Chapter 1 : Introduction
13



                                                                                     Java Editions


                         •        J2ME (Micro Edition) : Used to create programs
                                  that run on small handheld devices, such as phones,
                                  PDAs (personal digital assistants), and appliances.

                         •        J2SE (Standard Edition) : Used primarily to create
                                  programs for desktop computers or for many
                                  computers too large for J2ME and too small for
                                  J2EE.

                         •        J2EE (Enterprise Edition) : Used to create very
                                  large programs that run on servers managing heavy
                                  traffic and complicated transactions. These
                                  programs are the backbone of many online services,


Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University                   Computer Programming, Chapter 1 : Introduction
14



                                      Common Misconceptions About Java


                         •        Java is an extension of programmer

                         •        Java is an easy programming to learn

                         •        Java is an easy environment in which to program

                         •        Java will become a universal programming for all
                                  platforms

                         •        Java is just another programming language




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University   Computer Programming, Chapter 1 : Introduction
15



                                      Common Misconceptions About Java


                         •       Java is interpreted, so it is too slow for serious
                                 applications on a specific platform.

                         •       All Java program run inside a Web pages.

                         •       Java applets are a major security risk.

                         •       JavaScript is a simpler version of Java

                         •       You should use Java instead of Perl for CGI scripting




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University   Computer Programming, Chapter 1 : Introduction
16



                                      Common Misconceptions About Java


                         •       Java will revolutionize client-server computing.

                         •       Java will allow the component-based model of
                                 computing to take off

                         •       With Java, I can replace my computer with a $500
                                 “Internet appliance”




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University   Computer Programming, Chapter 1 : Introduction
17



                                        The Java programming environment


                         •        Compared to C++: no header files, macros, pointers
                                  and references, unions, operator overloading,
                                  templates, etc.

                         •        Object-orientation: Classes + Inheritance

                         •        Distributed: RMI, Servlet, Distributed object
                                  programming.

                         •        Robust: Strong typing + no pointer + garbage
                                  collection




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University   Computer Programming, Chapter 1 : Introduction
18



                                        The Java programming environment


                         •        Secure: Type-safety and access control

                         •        Architecture neutral: architecture neutral
                                  representation

                         •        Portable

                         •        Interpreted

                         •        High performance through Just in time compilation
                                  and runtime modification of code

                         •        Multi-threaded




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University   Computer Programming, Chapter 1 : Introduction
19



                                                                                 Java Features


                         •        Well defined primitive data types: int, float, double,
                                  char, etc.

                         •        int 4 bytes [–2,147,648, 2,147,483,647]

                         •        Control statements similar to C++: if-then-else,
                                  switch, while, for

                         •        Interfaces

                         •        Exceptions




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University               Computer Programming, Chapter 1 : Introduction
20



                                                                                 Java Features


                         •       Concurrency

                         •       Packages

                         •       Name spaces

                         •       Reflection

                         •       Applet model




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University               Computer Programming, Chapter 1 : Introduction
21



                                       The Java programming environment


                         •        Java programming language specification

                                •         Syntax of Java programs

                                •         Defines different constructs and their semantics

                         •        Java byte code: Intermediate representation for
                                  Java programs

                         •        Java compiler: Transform Java programs into Java
                                  byte code




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University   Computer Programming, Chapter 1 : Introduction
22



                                       The Java programming environment


                         •        Java interpreter: Read programs written in Java
                                  byte code and execute them

                         •        Java virtual machine: Runtime system that
                                  provides various services to running programs

                         •        Java programming environment: Set of libraries
                                  that provide services such as GUI, data
                                  structures,etc.

                         •        Java enabled browsers: Browsers that include a
                                  JVM + ability to load programs from remote hosts




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University   Computer Programming, Chapter 1 : Introduction
23



                                                            The Java Virtual Machine


                         •        The heart of the Java Platform is the concept of a
                                  "virtual machine" that executes Java bytecode
                                  programs.

                         •        Sits between the Java program and the machine it is
                                  running on.

                         •        Offers the program an “abstract computer” that
                                  executes the Java code

                         •        virtual machine isn't running on a CPU - it is being
                                  emulated on the CPU of the host machine.




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University     Computer Programming, Chapter 1 : Introduction
24



                                               How are Java programs written?


             HelloWorld.java                                                                          Compiler
             01: public class HelloWorld {
             02:                                                                                 javac HelloWorld.java
             03: public static void main(String[] args) {
             04:      System.out.println("Hello, World!");
             05: }
             06: }



                                                                                     HelloWorld.class (Java bytescodes)
                                                                                     01: ????1"
                                                                                     02:      @
                         Hello, World!                                               03:
                                                                                     init>()VCodeLineNumberTableLocalVariableTabl
                                                                                     ethis     LMidterm;main([Ljava/lang/
                                                                                     String;)Vargs[Ljava/lang/String;




                                                                                                      Interpreter

                                                                                                    java HelloWorld




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University                               Computer Programming, Chapter 1 : Introduction
25




                                                          Write once, run any Where

            HelloWorld.java
            01: public class HelloWorld {
                                                                                                         Compiler
            02:
            03: public static void main(String[] args) {
                                                                                                    javac HelloWorld.java
            04:      System.out.println("Hello, World!");
            05: }
            06: }


                                                                                                     HelloWorld.class




                          HelloWorld.class
                                                                                      Interpreter       Interpreter                    Interpreter

                           Java API

                     Java Virtual Machine

               Hardware-Based Platform
                                                                                     Win32            Linux                     MacOS

Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University                                          Computer Programming, Chapter 1 : Introduction
26



                                              How Will Java Change Your Life?


                         •       Get started quickly                                 •   Write once, run any
                                                                                         where
                         •       Write less code
                                                                                     •   Distribute software
                         •       Write better code                                       more easily

                         •       Develop program
                                 more quickly

                         •       Avoid platform
                                 dependencies with
                                 100% pure Java



Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University                     Computer Programming, Chapter 1 : Introduction
27



                                                    Analyzing Your First Program




                            01: package com.patumvan.atit.courses.compro.ch01.hello;
                            02:
                            03: public class HelloPrinter {
                            04:
                            05:    public static void main(String[] args) {
                            06:        System.out.println("Hello, World!");
                            07:    }
                            08: }




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University   Computer Programming, Chapter 1 : Introduction
28



                                                                                 Syntax Errors


                         •        Caused when the compiler cannot recognize a
                                  statement.

                         •        Are violations of the language

                         •        The compiler normally issues an error message to
                                  help the programmer locate and fix it

                         •        Also called compile errors or compile-time errors

                                   01:             public class Hello {
                                   02:                 pooblic static void main(String[] args) {
                                   03:                     System.owt.println("Hello, world!")_
                                   04:                 }
                                   05:             }


Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University               Computer Programming, Chapter 1 : Introduction
29



                                                                             Run-time Errors


                         •        Other major kind of error you’ll see

                         •        Happens when a program is running

                         •        We will talk more about these later

                         •        The compiler cannot identify these errors at compile
                                  time.




Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University             Computer Programming, Chapter 1 : Introduction

More Related Content

What's hot

Programming Fundamentals lecture 2
Programming Fundamentals lecture 2Programming Fundamentals lecture 2
Programming Fundamentals lecture 2REHAN IJAZ
 
Language translator
Language translatorLanguage translator
Language translatorasmakh89
 
Program & language generation
Program & language generationProgram & language generation
Program & language generationBuxoo Abdullah
 
Types and components of computer system
Types and components of computer systemTypes and components of computer system
Types and components of computer systemhome
 
Rtos concepts
Rtos conceptsRtos concepts
Rtos conceptsanishgoel
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1REHAN IJAZ
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time SystemsDeepak John
 
Basic programming concepts
Basic programming conceptsBasic programming concepts
Basic programming conceptssalmankhan570
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programmingmshellman
 
Chapter1 introduction to computer systems
Chapter1 introduction to computer systemsChapter1 introduction to computer systems
Chapter1 introduction to computer systemsMuhammad Waqas
 
Operating system notes
Operating system notesOperating system notes
Operating system notesSANTOSH RATH
 
Quality and productivity factors
Quality and productivity factorsQuality and productivity factors
Quality and productivity factorsNancyBeaulah_R
 
introduction to programming languages
introduction to programming languagesintroduction to programming languages
introduction to programming languagesNaqashAhmad14
 
System software and application software
System software and application softwareSystem software and application software
System software and application softwareSanjay Vasava
 
Introduction to basic programming
Introduction to basic programmingIntroduction to basic programming
Introduction to basic programmingJordan Delacruz
 
Visual programming lecture
Visual programming lecture Visual programming lecture
Visual programming lecture AqsaHayat3
 

What's hot (20)

Programming Fundamentals lecture 2
Programming Fundamentals lecture 2Programming Fundamentals lecture 2
Programming Fundamentals lecture 2
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
Language translator
Language translatorLanguage translator
Language translator
 
Program & language generation
Program & language generationProgram & language generation
Program & language generation
 
Types and components of computer system
Types and components of computer systemTypes and components of computer system
Types and components of computer system
 
Rtos concepts
Rtos conceptsRtos concepts
Rtos concepts
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
Basic programming concepts
Basic programming conceptsBasic programming concepts
Basic programming concepts
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programming
 
The Programming Process
The Programming ProcessThe Programming Process
The Programming Process
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Chapter1 introduction to computer systems
Chapter1 introduction to computer systemsChapter1 introduction to computer systems
Chapter1 introduction to computer systems
 
Operating system notes
Operating system notesOperating system notes
Operating system notes
 
Quality and productivity factors
Quality and productivity factorsQuality and productivity factors
Quality and productivity factors
 
History of programming
History of programmingHistory of programming
History of programming
 
introduction to programming languages
introduction to programming languagesintroduction to programming languages
introduction to programming languages
 
System software and application software
System software and application softwareSystem software and application software
System software and application software
 
Introduction to basic programming
Introduction to basic programmingIntroduction to basic programming
Introduction to basic programming
 
Visual programming lecture
Visual programming lecture Visual programming lecture
Visual programming lecture
 

Similar to Intro to Computer Programming Chapter 1

Form5 cd1
Form5 cd1Form5 cd1
Form5 cd1smktsj2
 
Introduction to computer programming
Introduction to computer programming Introduction to computer programming
Introduction to computer programming VanessaBuensalida
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer scienceumardanjumamaiwada
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer scienceumardanjumamaiwada
 
Generation of Computer language by arya dutta (1).pptx
Generation of Computer language by arya dutta (1).pptxGeneration of Computer language by arya dutta (1).pptx
Generation of Computer language by arya dutta (1).pptxAryaDutta4
 
Speech To Speech Translation
Speech To Speech TranslationSpeech To Speech Translation
Speech To Speech TranslationIRJET Journal
 
Python Programming Unit1_Aditya College of Engg & Tech
Python Programming Unit1_Aditya College of Engg & TechPython Programming Unit1_Aditya College of Engg & Tech
Python Programming Unit1_Aditya College of Engg & TechRamanamurthy Banda
 
Programming language
Programming languageProgramming language
Programming languageShuja Qais
 
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi Professor Lili Saghafi
 
Third and fourth generation programming language
Third and fourth generation programming languageThird and fourth generation programming language
Third and fourth generation programming languageomeed
 
Lec21&22.pptx programing language and there study
Lec21&22.pptx programing language and there studyLec21&22.pptx programing language and there study
Lec21&22.pptx programing language and there studysamiullahamjad06
 
Programming Fundamentals and Programming Languages Concepts
Programming Fundamentals and Programming Languages ConceptsProgramming Fundamentals and Programming Languages Concepts
Programming Fundamentals and Programming Languages Conceptsimtiazalijoono
 

Similar to Intro to Computer Programming Chapter 1 (20)

Form5 cd1
Form5 cd1Form5 cd1
Form5 cd1
 
programming.pptx
programming.pptxprogramming.pptx
programming.pptx
 
sege.pdf
sege.pdfsege.pdf
sege.pdf
 
Introduction to computer programming
Introduction to computer programming Introduction to computer programming
Introduction to computer programming
 
Programming language
Programming languageProgramming language
Programming language
 
lecture 4
 lecture 4 lecture 4
lecture 4
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
 
Generation of Computer language by arya dutta (1).pptx
Generation of Computer language by arya dutta (1).pptxGeneration of Computer language by arya dutta (1).pptx
Generation of Computer language by arya dutta (1).pptx
 
Speech To Speech Translation
Speech To Speech TranslationSpeech To Speech Translation
Speech To Speech Translation
 
Software
SoftwareSoftware
Software
 
Python Programming Unit1_Aditya College of Engg & Tech
Python Programming Unit1_Aditya College of Engg & TechPython Programming Unit1_Aditya College of Engg & Tech
Python Programming Unit1_Aditya College of Engg & Tech
 
Programming languages.pptx
Programming languages.pptxProgramming languages.pptx
Programming languages.pptx
 
Programming language
Programming languageProgramming language
Programming language
 
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
 
Third and fourth generation programming language
Third and fourth generation programming languageThird and fourth generation programming language
Third and fourth generation programming language
 
Lec21&22.pptx programing language and there study
Lec21&22.pptx programing language and there studyLec21&22.pptx programing language and there study
Lec21&22.pptx programing language and there study
 
Programming Fundamentals and Programming Languages Concepts
Programming Fundamentals and Programming Languages ConceptsProgramming Fundamentals and Programming Languages Concepts
Programming Fundamentals and Programming Languages Concepts
 
Notacd07
Notacd07Notacd07
Notacd07
 
Nota programming
Nota programmingNota programming
Nota programming
 

More from Atit Patumvan

Iot for smart agriculture
Iot for smart agricultureIot for smart agriculture
Iot for smart agricultureAtit Patumvan
 
An Overview of eZee Burrp! (Philus Limited)
An Overview of eZee Burrp! (Philus Limited)An Overview of eZee Burrp! (Philus Limited)
An Overview of eZee Burrp! (Philus Limited)Atit Patumvan
 
แบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ต
แบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ตแบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ต
แบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ตAtit Patumvan
 
Chapter 1 mathmatics tools
Chapter 1 mathmatics toolsChapter 1 mathmatics tools
Chapter 1 mathmatics toolsAtit Patumvan
 
Chapter 1 mathmatics tools
Chapter 1 mathmatics toolsChapter 1 mathmatics tools
Chapter 1 mathmatics toolsAtit Patumvan
 
รายงานการประเมินคุณภาพภายใน ปีงบประมาณ 2556
รายงานการประเมินคุณภาพภายใน ปีงบประมาณ 2556รายงานการประเมินคุณภาพภายใน ปีงบประมาณ 2556
รายงานการประเมินคุณภาพภายใน ปีงบประมาณ 2556Atit Patumvan
 
Chapter 0 introduction to theory of computation
Chapter 0 introduction to theory of computationChapter 0 introduction to theory of computation
Chapter 0 introduction to theory of computationAtit Patumvan
 
Chapter 01 mathmatics tools (slide)
Chapter 01 mathmatics tools (slide)Chapter 01 mathmatics tools (slide)
Chapter 01 mathmatics tools (slide)Atit Patumvan
 
การบริหารเชิงคุณภาพ ชุดที่ 8
การบริหารเชิงคุณภาพ ชุดที่ 8การบริหารเชิงคุณภาพ ชุดที่ 8
การบริหารเชิงคุณภาพ ชุดที่ 8Atit Patumvan
 
การบริหารเชิงคุณภาพ ชุดที่ 7
การบริหารเชิงคุณภาพ ชุดที่ 7การบริหารเชิงคุณภาพ ชุดที่ 7
การบริหารเชิงคุณภาพ ชุดที่ 7Atit Patumvan
 
การบริหารเชิงคุณภาพ ชุดที่ 6
การบริหารเชิงคุณภาพ ชุดที่ 6การบริหารเชิงคุณภาพ ชุดที่ 6
การบริหารเชิงคุณภาพ ชุดที่ 6Atit Patumvan
 
Computer Programming Chapter 5 : Methods
Computer Programming Chapter 5 : MethodsComputer Programming Chapter 5 : Methods
Computer Programming Chapter 5 : MethodsAtit Patumvan
 
Computer Programming Chapter 4 : Loops
Computer Programming Chapter 4 : Loops Computer Programming Chapter 4 : Loops
Computer Programming Chapter 4 : Loops Atit Patumvan
 
Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)Atit Patumvan
 
การบริหารเชิงคุณภาพ ชุดที่ 5
การบริหารเชิงคุณภาพ ชุดที่ 5การบริหารเชิงคุณภาพ ชุดที่ 5
การบริหารเชิงคุณภาพ ชุดที่ 5Atit Patumvan
 
การบริหารเชิงคุณภาพ ชุดที่ 4
การบริหารเชิงคุณภาพ ชุดที่ 4การบริหารเชิงคุณภาพ ชุดที่ 4
การบริหารเชิงคุณภาพ ชุดที่ 4Atit Patumvan
 
การบริหารเชิงคุณภาพ ชุดที่ 3
การบริหารเชิงคุณภาพ ชุดที่ 3การบริหารเชิงคุณภาพ ชุดที่ 3
การบริหารเชิงคุณภาพ ชุดที่ 3Atit Patumvan
 
การบริหารเชิงคุณภาพ ชุดที่ 2
การบริหารเชิงคุณภาพ ชุดที่ 2การบริหารเชิงคุณภาพ ชุดที่ 2
การบริหารเชิงคุณภาพ ชุดที่ 2Atit Patumvan
 
การบริหารเชิงคุณภาพ ชุดที่ 1
การบริหารเชิงคุณภาพ ชุดที่ 1การบริหารเชิงคุณภาพ ชุดที่ 1
การบริหารเชิงคุณภาพ ชุดที่ 1Atit Patumvan
 

More from Atit Patumvan (20)

Iot for smart agriculture
Iot for smart agricultureIot for smart agriculture
Iot for smart agriculture
 
An Overview of eZee Burrp! (Philus Limited)
An Overview of eZee Burrp! (Philus Limited)An Overview of eZee Burrp! (Philus Limited)
An Overview of eZee Burrp! (Philus Limited)
 
แบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ต
แบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ตแบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ต
แบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ต
 
Chapter 1 mathmatics tools
Chapter 1 mathmatics toolsChapter 1 mathmatics tools
Chapter 1 mathmatics tools
 
Chapter 1 mathmatics tools
Chapter 1 mathmatics toolsChapter 1 mathmatics tools
Chapter 1 mathmatics tools
 
รายงานการประเมินคุณภาพภายใน ปีงบประมาณ 2556
รายงานการประเมินคุณภาพภายใน ปีงบประมาณ 2556รายงานการประเมินคุณภาพภายใน ปีงบประมาณ 2556
รายงานการประเมินคุณภาพภายใน ปีงบประมาณ 2556
 
Chapter 0 introduction to theory of computation
Chapter 0 introduction to theory of computationChapter 0 introduction to theory of computation
Chapter 0 introduction to theory of computation
 
Media literacy
Media literacyMedia literacy
Media literacy
 
Chapter 01 mathmatics tools (slide)
Chapter 01 mathmatics tools (slide)Chapter 01 mathmatics tools (slide)
Chapter 01 mathmatics tools (slide)
 
การบริหารเชิงคุณภาพ ชุดที่ 8
การบริหารเชิงคุณภาพ ชุดที่ 8การบริหารเชิงคุณภาพ ชุดที่ 8
การบริหารเชิงคุณภาพ ชุดที่ 8
 
การบริหารเชิงคุณภาพ ชุดที่ 7
การบริหารเชิงคุณภาพ ชุดที่ 7การบริหารเชิงคุณภาพ ชุดที่ 7
การบริหารเชิงคุณภาพ ชุดที่ 7
 
การบริหารเชิงคุณภาพ ชุดที่ 6
การบริหารเชิงคุณภาพ ชุดที่ 6การบริหารเชิงคุณภาพ ชุดที่ 6
การบริหารเชิงคุณภาพ ชุดที่ 6
 
Computer Programming Chapter 5 : Methods
Computer Programming Chapter 5 : MethodsComputer Programming Chapter 5 : Methods
Computer Programming Chapter 5 : Methods
 
Computer Programming Chapter 4 : Loops
Computer Programming Chapter 4 : Loops Computer Programming Chapter 4 : Loops
Computer Programming Chapter 4 : Loops
 
Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)
 
การบริหารเชิงคุณภาพ ชุดที่ 5
การบริหารเชิงคุณภาพ ชุดที่ 5การบริหารเชิงคุณภาพ ชุดที่ 5
การบริหารเชิงคุณภาพ ชุดที่ 5
 
การบริหารเชิงคุณภาพ ชุดที่ 4
การบริหารเชิงคุณภาพ ชุดที่ 4การบริหารเชิงคุณภาพ ชุดที่ 4
การบริหารเชิงคุณภาพ ชุดที่ 4
 
การบริหารเชิงคุณภาพ ชุดที่ 3
การบริหารเชิงคุณภาพ ชุดที่ 3การบริหารเชิงคุณภาพ ชุดที่ 3
การบริหารเชิงคุณภาพ ชุดที่ 3
 
การบริหารเชิงคุณภาพ ชุดที่ 2
การบริหารเชิงคุณภาพ ชุดที่ 2การบริหารเชิงคุณภาพ ชุดที่ 2
การบริหารเชิงคุณภาพ ชุดที่ 2
 
การบริหารเชิงคุณภาพ ชุดที่ 1
การบริหารเชิงคุณภาพ ชุดที่ 1การบริหารเชิงคุณภาพ ชุดที่ 1
การบริหารเชิงคุณภาพ ชุดที่ 1
 

Recently uploaded

Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 

Recently uploaded (20)

Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 

Intro to Computer Programming Chapter 1

  • 1. Computer Programming Chapter 1 : Introduction Atit Patumvan Faculty of Management and Information Sciences Naresuan University
  • 2. 2 What is Programming? • Computers are programmed to perform tasks • Different tasks = different programs • Program • Sequence of basic operations executed in succession • Contains instruction sequences for all tasks it can execute • Sophisticated programs require teams of highly skilled programmers and other professionals Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 3. 3 History Timeline Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 4. 4 The Evolution of Programming Languages • To build programs, people use languages that are similar to human language. The results are translated into machine code, which computers understand. • Programming languages fall into three broad categories: • Machine languages • Assembly languages • Higher-level Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 5. 5 Assembly Languages • Assembly languages (second-generation languages) are only somewhat easier to work with than machine languages. • To create programs in assembly language, developers use cryptic English-like phrases to represent strings of numbers. • The code is then translated into object code, using a translator called an assembler. Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 6. 6 Assembly Languages Assembly Code Assembler Assembly Code Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 7. 7 Higher-Level Languages • Higher-level languages are more powerful than assembly language and allow the programmer to work in a more English-like environment. • Higher-level programming languages are divided into three "generations," each more powerful than the last: • Third-generation languages • Fourth-generation languages • Fifth-generation languages Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 8. 8 Third-generation languages • Third-generation languages (3GLs) are the first to use true English-like phrasing, making them easier to ! use than previous languages. • 3GLs are portable, meaning the object code created for one type of system can be translated for use on a different type of system. • The following languages are 3GLs FORTAN BASIC PHP C Java JavaScript COBOL Pascal Ruby C++ C# Python Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 9. 9 A Typical Program Development Environment Edit Program is created in the editor and stored on disk Preprocess Preprocessor program processes the code Compile Compiler creates object code and stores it on disk. Link Linker links the object code with the libraries Load Loader puts program in memory Execute CPU takes each instruction and executes it Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 10. 10 Fourth-Generation Languages • Fourth-generation languages (4GLs) are even easier to use than 3GLs. • 4GLs may use a text-based environment (like a 3GL) or may allow the programmer to work in a visual environment, using graphical tools. • The following languages are 4GLs: Visual Basic Magic Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 11. 11 Fifth-Generation Languages • Fifth-generation languages (5GLs) are an issue of debate in the programming community – some programmers !cannot agree that they even exist. • These high-level languages would use artificial intelligence to create software, making 5GLs extremely difficult to develop. • Solve problems using constraints rather than algorithms, used in Artificial Intelligence Prolog CLIPs Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 12. 12 History of Java Language • JDK 1.0 (January 23, 1996) • Java SE 7 (July 7, 2011) • JDK 1.1 (February 19, 1997) • Java SE 8 (expected in summer 2013) • J2SE 1.2 (December 8, 1998) • J2SE 1.3 (May 8, 2000) • J2SE 1.4 (February 6, 2002) • J2SE 5.0 (September 30, 2004) • Java SE 6 (December 11, 2006) Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 13. 13 Java Editions • J2ME (Micro Edition) : Used to create programs that run on small handheld devices, such as phones, PDAs (personal digital assistants), and appliances. • J2SE (Standard Edition) : Used primarily to create programs for desktop computers or for many computers too large for J2ME and too small for J2EE. • J2EE (Enterprise Edition) : Used to create very large programs that run on servers managing heavy traffic and complicated transactions. These programs are the backbone of many online services, Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 14. 14 Common Misconceptions About Java • Java is an extension of programmer • Java is an easy programming to learn • Java is an easy environment in which to program • Java will become a universal programming for all platforms • Java is just another programming language Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 15. 15 Common Misconceptions About Java • Java is interpreted, so it is too slow for serious applications on a specific platform. • All Java program run inside a Web pages. • Java applets are a major security risk. • JavaScript is a simpler version of Java • You should use Java instead of Perl for CGI scripting Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 16. 16 Common Misconceptions About Java • Java will revolutionize client-server computing. • Java will allow the component-based model of computing to take off • With Java, I can replace my computer with a $500 “Internet appliance” Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 17. 17 The Java programming environment • Compared to C++: no header files, macros, pointers and references, unions, operator overloading, templates, etc. • Object-orientation: Classes + Inheritance • Distributed: RMI, Servlet, Distributed object programming. • Robust: Strong typing + no pointer + garbage collection Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 18. 18 The Java programming environment • Secure: Type-safety and access control • Architecture neutral: architecture neutral representation • Portable • Interpreted • High performance through Just in time compilation and runtime modification of code • Multi-threaded Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 19. 19 Java Features • Well defined primitive data types: int, float, double, char, etc. • int 4 bytes [–2,147,648, 2,147,483,647] • Control statements similar to C++: if-then-else, switch, while, for • Interfaces • Exceptions Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 20. 20 Java Features • Concurrency • Packages • Name spaces • Reflection • Applet model Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 21. 21 The Java programming environment • Java programming language specification • Syntax of Java programs • Defines different constructs and their semantics • Java byte code: Intermediate representation for Java programs • Java compiler: Transform Java programs into Java byte code Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 22. 22 The Java programming environment • Java interpreter: Read programs written in Java byte code and execute them • Java virtual machine: Runtime system that provides various services to running programs • Java programming environment: Set of libraries that provide services such as GUI, data structures,etc. • Java enabled browsers: Browsers that include a JVM + ability to load programs from remote hosts Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 23. 23 The Java Virtual Machine • The heart of the Java Platform is the concept of a "virtual machine" that executes Java bytecode programs. • Sits between the Java program and the machine it is running on. • Offers the program an “abstract computer” that executes the Java code • virtual machine isn't running on a CPU - it is being emulated on the CPU of the host machine. Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 24. 24 How are Java programs written? HelloWorld.java Compiler 01: public class HelloWorld { 02: javac HelloWorld.java 03: public static void main(String[] args) { 04: System.out.println("Hello, World!"); 05: } 06: } HelloWorld.class (Java bytescodes) 01: ????1" 02: @ Hello, World! 03: init>()VCodeLineNumberTableLocalVariableTabl ethis LMidterm;main([Ljava/lang/ String;)Vargs[Ljava/lang/String; Interpreter java HelloWorld Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 25. 25 Write once, run any Where HelloWorld.java 01: public class HelloWorld { Compiler 02: 03: public static void main(String[] args) { javac HelloWorld.java 04: System.out.println("Hello, World!"); 05: } 06: } HelloWorld.class HelloWorld.class Interpreter Interpreter Interpreter Java API Java Virtual Machine Hardware-Based Platform Win32 Linux MacOS Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 26. 26 How Will Java Change Your Life? • Get started quickly • Write once, run any where • Write less code • Distribute software • Write better code more easily • Develop program more quickly • Avoid platform dependencies with 100% pure Java Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 27. 27 Analyzing Your First Program 01: package com.patumvan.atit.courses.compro.ch01.hello; 02: 03: public class HelloPrinter { 04: 05: public static void main(String[] args) { 06: System.out.println("Hello, World!"); 07: } 08: } Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 28. 28 Syntax Errors • Caused when the compiler cannot recognize a statement. • Are violations of the language • The compiler normally issues an error message to help the programmer locate and fix it • Also called compile errors or compile-time errors 01: public class Hello { 02: pooblic static void main(String[] args) { 03: System.owt.println("Hello, world!")_ 04: } 05: } Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction
  • 29. 29 Run-time Errors • Other major kind of error you’ll see • Happens when a program is running • We will talk more about these later • The compiler cannot identify these errors at compile time. Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Computer Programming, Chapter 1 : Introduction