Your SlideShare is downloading. ×
พื้นฐานภาษาจาวา
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

พื้นฐานภาษาจาวา

146

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
146
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Dr.Jame Gosling Sun Microsystems Oak) Java)
  • 2. 1) OOP: Object Oriented Programming) 2) Java platform independence java 3) Free Source Open
  • 3. Java 1. Structure 1.1 Comment Source code - comment comment //comment comment - comment comment */ /* Comment Comment */
  • 4. 1.2 Keyword Java class,boolean,char 1.3 Identifiers method , , class ,_,$
  • 5. Java 1) Java Application Java 2) Java Applets Java HTML Browser Utilities Web Java
  • 6. 1.4 Separators 1. 2. 3. method parameter private void hello( ); if ,while,for ,do if ( i=0 ) casting String a=( String )x;
  • 7. 1. 2. - 1. Array String a[ ]; index a[ 0 ]=10; ; String a ; , array String a , b , c; 1. 2. package,subpackage package com.test.Test1; method object.hello(); class Object
  • 8. - {} method class class A{ } Private void hello(){ } 2. String a[]={"A","B","C"}; Array
  • 9. Scanner Scanner keyboard; keyboard Scanner new = new ( );
  • 10. keyboard System.in keyboard = new Scanner(System.in); Scanner
  • 11. nextByte () nextDou ble() nextFloat () nextInt() nextLine( Byte Double Float Int
  • 12. int number; Scanner keyboard = new Scanner(System.in); System.out.print(“Enter an integer value: “); number = keyboard.nextInt();
  • 13. import import import Scanner import java.util.Scanner Scanner java util util
  • 14. Operators) Arithmetic Operators)
  • 15. Operator "*"(Multiply) 1 "/" (Divide) 2 "%" (Modulus) 3 "+" (Add) 4 "-" (Minus) op1-op1: 5
  • 16. class BasicMath{ public static void main (String args[]){ int a = 1 + 1; int b = a * 3; int c = b / 4; int d = b " a; int e = -d; int f = 9%5; System.out.println("a = " + a); System.out.println("b = " + b); System.out.println("c = " + c); System.out.println("e = " + e); System.out.println("9%5 = " + 9%5); } }
  • 17. Relational Operators) Boolean)
  • 18. Relational Operator < Op1<Op2 : Op2 <= Op1<=Op2 : Op2 Op1 Op1 a=(1<3); //a a=(5<=7); //a Op2 > Op1>Op2 : Op1 >= Op1>=Op2 : Op2 Op1 a=(5>=7); //a == Op1==Op2 : Op2 Op1 a=(5==7); // a 5 7 != Op1!=Op2 : Op2 ": (expression)"a:b : expression Op1 operand a Op2 a=(5>7); //a a=(5!=7); // a 5 7 a=(3>5)"false:true; //a 3 5 true
  • 19. Logical Operators) Boolean
  • 20. 1 2 AND true 1 true true 1 false false 0 true false 0 false 1 true 0 false 1 false 0 false 1 OR XOR true 1 false 0 true 1 true 1 0 true 1 true 1 0 false 0 false 0 0
  • 21. Boolean Operator Operator ! NOT) !(Op1) && AND) Op1 && Op2 Op2 || OR) Op1 || Op2 Op2 a= !(true); // a Op1 a= !(true && false); // a Op1 a= !(true); // a
  • 22. String String Class java.lang ” character 1 Class “String” Package “ 1 “String” String Class
  • 23. Object String 6 1 String Object = new String( ; 2 String Object = ; 3 String (char chars[]); String Array Chars String
  • 24. 4 String (char chars[], int startIndex, int numChars); Array String startIndex array numChars startIndex
  • 25. 5 String ( String String String ; String String 6 Array ASCII - String (byte asciiChars[]); String
  • 26. http://www.sourcecode.in.th/lession.php?no= &group= https://sites.google.com/site/javabasiceaw/home http://java see.blogspot.com/ java-java-structure.

×