SlideShare una empresa de Scribd logo
1 de 34
Public class Simple{
      Public static void main(String[]args){
             System.out.println(“Programming is
great fun!”);
      }
}
Simple

Simple.java                System.out.println

(;)
                                        public   class




public static void main(String[]args)
main
                       public
static

         void
                main
print   println

          out               System

 System.out.print(data);
System.out.println(data);
          data
print
println
print       println
       escape sequence

escape sequence
      n          Newline
      t          Horizontal tab
      b          Backspace

      r          Return

                Backslash                
      ’          Single quote             ’
      ”          Double quote             “
2.3
true(     )       false(   )



   char
Unicode                                        ‘‘
                        Unicode
          u



               byte, short, int        long
float      double                  float
                    double
              float        f              F

boolean   1                      true          false
char      2                                              Unicode
byte      1               -128          +127
short     2               -32,768            +32,767
int       4               -2,147,483,648
                          +2,147,483,647
long      8               -2---63         2---63 -
float     4                -        x    -           -      x

double    8                -     x 10-308              -        x
                          10+308
A–Z,a–z,$   _


        .




            final
final                   =           ;
//
                         /*               */
3.                                        /**
         */


              total = const + tax;
     -        Cost = total – tax;         –
              Tax = cost * rate;
              Saleprice =
              original / 2
     %        Ramainder = value
              % 3;
                                          – ,
- (unary
negation)


*/%

+-
=       X = 5;         X = X + 5;
          -=        Y -= 2;       Y = Y – 2;
          *=       Z *= 10;       Z = Z * 10;
          /=        A /= b;       A = A / b;
          %=       C %= 3;        C = C % 3;




               –


y = x++            y          x
-
-




                 Cast Operator

              Cast Operator


x = (int)number;
               number            int
double
                 double
        2.                float

float
        3.
             long
                          long




             String
(   )
   Method
charAt(inde       index
x)
length()
toLowerCas
e()
toUpperCas
e()
Scanner

Scanner keyboard;
                                keyboard
      Scanner
        new
                = new        (             );
                         keyboard

               System.in
keyboard = new Scanner(System.in);
Scanner




nextByte()                       Byte
nextDouble()                 Double


nextFloat()                  Float
nextInt()                        Int
nextLine()
nextLong()               Long
nextShort()              Short
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java
บทที่ 3 พื้นฐานภาษา Java

Más contenido relacionado

La actualidad más candente

JavaScript - Agora nervoso
JavaScript - Agora nervosoJavaScript - Agora nervoso
JavaScript - Agora nervosoLuis Vendrame
 
[신경망기초]오류역전파알고리즘구현
[신경망기초]오류역전파알고리즘구현[신경망기초]오류역전파알고리즘구현
[신경망기초]오류역전파알고리즘구현jaypi Ko
 
Finagle By Twitter Engineer @ Knoldus
Finagle By Twitter Engineer @ KnoldusFinagle By Twitter Engineer @ Knoldus
Finagle By Twitter Engineer @ KnoldusKnoldus Inc.
 
The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)GroovyPuzzlers
 
Hacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 AutumnHacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 AutumnMoriyoshi Koizumi
 
[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망jaypi Ko
 
Taking Inspiration From The Functional World
Taking Inspiration From The Functional WorldTaking Inspiration From The Functional World
Taking Inspiration From The Functional WorldPiotr Solnica
 
Trip itparsing
Trip itparsingTrip itparsing
Trip itparsingCapIpad
 
Laziness in Swift
Laziness in Swift Laziness in Swift
Laziness in Swift SwiftWro
 
Зависимые типы в GHC 8. Максим Талдыкин
Зависимые типы в GHC 8. Максим ТалдыкинЗависимые типы в GHC 8. Максим Талдыкин
Зависимые типы в GHC 8. Максим ТалдыкинЮрий Сыровецкий
 
Intoduction to dynamic memory allocation
Intoduction to dynamic memory allocationIntoduction to dynamic memory allocation
Intoduction to dynamic memory allocationUtsav276
 
Composition in JavaScript
Composition in JavaScriptComposition in JavaScript
Composition in JavaScriptJosh Mock
 
Generics and Inference
Generics and InferenceGenerics and Inference
Generics and InferenceRichard Fox
 
PFDS 4章をOCamlに翻訳
PFDS 4章をOCamlに翻訳PFDS 4章をOCamlに翻訳
PFDS 4章をOCamlに翻訳Kiwamu Okabe
 

La actualidad más candente (20)

Metarhia KievJS 22-Feb-2018
Metarhia KievJS 22-Feb-2018Metarhia KievJS 22-Feb-2018
Metarhia KievJS 22-Feb-2018
 
JavaScript - Agora nervoso
JavaScript - Agora nervosoJavaScript - Agora nervoso
JavaScript - Agora nervoso
 
Yahoo! JAPANとKotlin
Yahoo! JAPANとKotlinYahoo! JAPANとKotlin
Yahoo! JAPANとKotlin
 
Matlab code for secant method
Matlab code for secant methodMatlab code for secant method
Matlab code for secant method
 
[신경망기초]오류역전파알고리즘구현
[신경망기초]오류역전파알고리즘구현[신경망기초]오류역전파알고리즘구현
[신경망기초]오류역전파알고리즘구현
 
Finagle By Twitter Engineer @ Knoldus
Finagle By Twitter Engineer @ KnoldusFinagle By Twitter Engineer @ Knoldus
Finagle By Twitter Engineer @ Knoldus
 
The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)
 
Hacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 AutumnHacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 Autumn
 
[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망
 
Taking Inspiration From The Functional World
Taking Inspiration From The Functional WorldTaking Inspiration From The Functional World
Taking Inspiration From The Functional World
 
Trip itparsing
Trip itparsingTrip itparsing
Trip itparsing
 
Laziness in Swift
Laziness in Swift Laziness in Swift
Laziness in Swift
 
c programming
c programmingc programming
c programming
 
Зависимые типы в GHC 8. Максим Талдыкин
Зависимые типы в GHC 8. Максим ТалдыкинЗависимые типы в GHC 8. Максим Талдыкин
Зависимые типы в GHC 8. Максим Талдыкин
 
Intoduction to dynamic memory allocation
Intoduction to dynamic memory allocationIntoduction to dynamic memory allocation
Intoduction to dynamic memory allocation
 
C++ L08-Classes Part1
C++ L08-Classes Part1C++ L08-Classes Part1
C++ L08-Classes Part1
 
Composition in JavaScript
Composition in JavaScriptComposition in JavaScript
Composition in JavaScript
 
Generics and Inference
Generics and InferenceGenerics and Inference
Generics and Inference
 
PFDS 4章をOCamlに翻訳
PFDS 4章をOCamlに翻訳PFDS 4章をOCamlに翻訳
PFDS 4章をOCamlに翻訳
 
Sigma type
Sigma typeSigma type
Sigma type
 

Destacado

#งานย่อย 6 ตั้งคำถาม 5 ข้อ
#งานย่อย 6 ตั้งคำถาม 5 ข้อ#งานย่อย 6 ตั้งคำถาม 5 ข้อ
#งานย่อย 6 ตั้งคำถาม 5 ข้อItslvle Parin
 
ส่งประกวด
ส่งประกวดส่งประกวด
ส่งประกวดItslvle Parin
 
วิจารณ์กลุ่มสอง
วิจารณ์กลุ่มสองวิจารณ์กลุ่มสอง
วิจารณ์กลุ่มสองItslvle Parin
 
สรุปการประเมินนำเสนอหน้าชั้นเรียนกลุ่ม3
สรุปการประเมินนำเสนอหน้าชั้นเรียนกลุ่ม3สรุปการประเมินนำเสนอหน้าชั้นเรียนกลุ่ม3
สรุปการประเมินนำเสนอหน้าชั้นเรียนกลุ่ม3thelaw191
 
#งานย่อย 6 แบบทดสอบ
#งานย่อย 6 แบบทดสอบ#งานย่อย 6 แบบทดสอบ
#งานย่อย 6 แบบทดสอบItslvle Parin
 
แก้งานย่อย 7
แก้งานย่อย 7แก้งานย่อย 7
แก้งานย่อย 7Itslvle Parin
 

Destacado (7)

#งานย่อย 6 ตั้งคำถาม 5 ข้อ
#งานย่อย 6 ตั้งคำถาม 5 ข้อ#งานย่อย 6 ตั้งคำถาม 5 ข้อ
#งานย่อย 6 ตั้งคำถาม 5 ข้อ
 
ส่งประกวด
ส่งประกวดส่งประกวด
ส่งประกวด
 
วิจารณ์กลุ่มสอง
วิจารณ์กลุ่มสองวิจารณ์กลุ่มสอง
วิจารณ์กลุ่มสอง
 
สรุปการประเมินนำเสนอหน้าชั้นเรียนกลุ่ม3
สรุปการประเมินนำเสนอหน้าชั้นเรียนกลุ่ม3สรุปการประเมินนำเสนอหน้าชั้นเรียนกลุ่ม3
สรุปการประเมินนำเสนอหน้าชั้นเรียนกลุ่ม3
 
ข้อสอบ
ข้อสอบข้อสอบ
ข้อสอบ
 
#งานย่อย 6 แบบทดสอบ
#งานย่อย 6 แบบทดสอบ#งานย่อย 6 แบบทดสอบ
#งานย่อย 6 แบบทดสอบ
 
แก้งานย่อย 7
แก้งานย่อย 7แก้งานย่อย 7
แก้งานย่อย 7
 

Similar a บทที่ 3 พื้นฐานภาษา Java

Coscup2021-rust-toturial
Coscup2021-rust-toturialCoscup2021-rust-toturial
Coscup2021-rust-toturialWayne Tsai
 
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1Little Tukta Lita
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)Saifur Rahman
 
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321Teddy Hsiung
 
Python-GTK
Python-GTKPython-GTK
Python-GTKYuren Ju
 
Java 8 lambda expressions
Java 8 lambda expressionsJava 8 lambda expressions
Java 8 lambda expressionsLogan Chien
 
Google Go For Ruby Hackers
Google Go For Ruby HackersGoogle Go For Ruby Hackers
Google Go For Ruby HackersEleanor McHugh
 
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerKOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerAiman Hud
 
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан КольцовRust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан КольцовYandex
 
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM Language
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM LanguageCodeFest 2010. Иноземцев И. — Fantom. Cross-VM Language
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM LanguageCodeFest
 
Python GTK (Hacking Camp)
Python GTK (Hacking Camp)Python GTK (Hacking Camp)
Python GTK (Hacking Camp)Yuren Ju
 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)gekiaruj
 
A Layered Architecture for the Model-driven Development of Distributed Simula...
A Layered Architecture for the Model-driven Development of Distributed Simula...A Layered Architecture for the Model-driven Development of Distributed Simula...
A Layered Architecture for the Model-driven Development of Distributed Simula...Daniele Gianni
 

Similar a บทที่ 3 พื้นฐานภาษา Java (20)

Coscup2021-rust-toturial
Coscup2021-rust-toturialCoscup2021-rust-toturial
Coscup2021-rust-toturial
 
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)
 
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
 
Utility.ppt
Utility.pptUtility.ppt
Utility.ppt
 
Part 7
Part 7Part 7
Part 7
 
Python-GTK
Python-GTKPython-GTK
Python-GTK
 
Java 8 lambda expressions
Java 8 lambda expressionsJava 8 lambda expressions
Java 8 lambda expressions
 
Functions
FunctionsFunctions
Functions
 
Mcq cpup
Mcq cpupMcq cpup
Mcq cpup
 
Google Go For Ruby Hackers
Google Go For Ruby HackersGoogle Go For Ruby Hackers
Google Go For Ruby Hackers
 
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerKOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
 
Cpl
CplCpl
Cpl
 
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан КольцовRust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
 
Functions
FunctionsFunctions
Functions
 
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM Language
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM LanguageCodeFest 2010. Иноземцев И. — Fantom. Cross-VM Language
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM Language
 
Python GTK (Hacking Camp)
Python GTK (Hacking Camp)Python GTK (Hacking Camp)
Python GTK (Hacking Camp)
 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)
 
A Layered Architecture for the Model-driven Development of Distributed Simula...
A Layered Architecture for the Model-driven Development of Distributed Simula...A Layered Architecture for the Model-driven Development of Distributed Simula...
A Layered Architecture for the Model-driven Development of Distributed Simula...
 
บทที่ 3
บทที่ 3บทที่ 3
บทที่ 3
 

บทที่ 3 พื้นฐานภาษา Java

  • 1.
  • 2. Public class Simple{ Public static void main(String[]args){ System.out.println(“Programming is great fun!”); } }
  • 3. Simple Simple.java System.out.println (;) public class public static void main(String[]args)
  • 4. main public static void main
  • 5. print println out System System.out.print(data); System.out.println(data); data print println
  • 6. print println escape sequence escape sequence n Newline t Horizontal tab b Backspace r Return Backslash ’ Single quote ’ ” Double quote “
  • 7. 2.3
  • 8. true( ) false( ) char Unicode ‘‘ Unicode u byte, short, int long
  • 9. float double float double float f F boolean 1 true false char 2 Unicode byte 1 -128 +127 short 2 -32,768 +32,767 int 4 -2,147,483,648 +2,147,483,647 long 8 -2---63 2---63 - float 4 - x - - x double 8 - x 10-308 - x 10+308
  • 10. A–Z,a–z,$ _ . final final = ;
  • 11. // /* */ 3. /** */ total = const + tax; - Cost = total – tax; – Tax = cost * rate; Saleprice = original / 2 % Ramainder = value % 3; – ,
  • 13. = X = 5; X = X + 5; -= Y -= 2; Y = Y – 2; *= Z *= 10; Z = Z * 10; /= A /= b; A = A / b; %= C %= 3; C = C % 3; – y = x++ y x
  • 14. - - Cast Operator Cast Operator x = (int)number; number int
  • 15. double double 2. float float 3. long long String
  • 16. ( ) Method charAt(inde index x) length() toLowerCas e() toUpperCas e()
  • 17. Scanner Scanner keyboard; keyboard Scanner new = new ( ); keyboard System.in keyboard = new Scanner(System.in);
  • 18. Scanner nextByte() Byte nextDouble() Double nextFloat() Float nextInt() Int nextLine() nextLong() Long nextShort() Short