Recommended for beginners: Java source code example website

Source: Internet
Author: 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 queue List)
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

 

 

More visit: http://www.javadb.com/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.