JAVA ????????? - PowerPoint PPT Presentation

About This Presentation
Title:

JAVA ?????????

Description:

JAVA (Array) int a[]; int [] a; // int a[] = new ... – PowerPoint PPT presentation

Number of Views:28
Avg rating:3.0/5.0
Slides: 8
Provided by: Shaw1153
Category:

less

Transcript and Presenter's Notes

Title: JAVA ?????????


1
JAVA ?????????
  • ??? ??????????

2
?? (Array)
A.length???????,??Aindex????????
3
?????
  • int a ? int a // ??????
  • int a new intn // ?????n
  • int a 2, 5, 8 // ?????2,5,8
  • ???????
  • Int a
  • Int a new int23
  • Int a 1, 2, 3, 7, 8, 9

4
????
?????????
5
?? (String)
  • ?????
  • String s
  • String s ABC
  • String s null // String???,????null
  • String s new String()
  • String s new String(char)
  • String s new String(char, ???,??)
  • String s new String(A String)

6
????(?)-- charAt() length()
  • class StringDemo2
  •  
  • public static void main(String args)
  •  
  • String name "Sumantha"
  •  
  • int size name.length() // ??????
  •  
  • for(int i 0 i lt size i 2)
  •  
  • System.out.println(name.charAt(i))
  •  
  • // for
  •  
  • //main
  •  
  • //StringDemo2

7
StringTokenizer??
  • ?????????
  • ?????????,?
  • ? StringTokenizer st new StringTokenizer(str,
    )???????????
  • ??st.hasMoreTokens()?????????Token
  • ??st.nextToken() ????????Token
Write a Comment
User Comments (0)
About PowerShow.com