新手推薦:Java原始碼樣本網站

來源:互聯網
上載者:User

 

Arrays
Extend the size of an array
How to copy an array
Using the Comparable interface to compare and sort objects
How to sort an array

Collections
Using a Set (or HashSet)
Using a Queue (or LinkedList)
Using a Stack
Remove duplicate items from an ArrayList
Looping through a Collection object
  View more...

Compression
Extract contents of a zip file
How to list the contents of a zip file
How to create a zip file

Database
Connect to database and call stored procedure
Using a database transaction with JDBC
Connecting to a Database - Step by Step
Connect to a database and read from table

Datatype conversions
Convert byte[ ] array to String
Convert String to byte array
Convert String to Boolean
Convert Boolean to String
Convert byte to String
  View more...

File I/O
Read Input From User and Write to File
How to rename a file (change file name)
Remove a line from a text file
Loading configuration parameters from textfile into a program
Writing objects to file with ObjectOutputStream
  View more...

Graphics Java 2D
Drawing a Ractangle with rounded corners using Java 2D Graphics API
Drawing a Ractangle using Java 2D Graphics API
Drawing a Line using Java 2D Graphics API
Drawing a String using Java 2D Graphics API

Java Language Fundamentals
Convert Characters to Lower Case
Convert Characters to Upper Case
Replace Characters in a String
Getting a substring from a String
Check if String Contains another String
  View more...

Networking
Sending a POST Request with Parameters From a Java Class
Downloading a web page using URL and URLConnection classes
Perform NSLookup with the InetAddress class

Reflection
Instantiate unknown class at runtime and call the object's methods
List methods of a class using Reflection
Invoke methods of an object using reflection

Servlets
Redirect Servlet Call to Another URL
Forward Call from a Servlet
Get Users IP Address
Get and Set Session Variables in a Servlet
Get Request Parameters in a Servlet

Small programs
How to find and calculate prime numbers

Swing
Show a message dialog with JOptionPane
Set Look and Feel for a Swing application
JLabel with more than one row

Threads
Setting thread priorities
How to create a thread

Web Services
Using a Message Handler to alter the SOAP Header in a Web Service Client
Create a Web Service Client with JAX-WS
Create a simple Web Service

 

Tutorials

Java Language Tutorial

 

 

更多訪問:http://www.javadb.com/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.