Java Examples

This chapter we will introduce examples of commonly used Java, by way of example, we can learn quickly grasp Java applications.

Java environment setting example

  1. Java examples - how to build a Java file?
  2. Examples of Java - Java how to run a compiled class files?
  3. Java example - how to perform the specified class file directory (classpath)?
  4. Java examples - how to view the current version of Java running?

Java string

  1. Java Examples - string comparison
  2. Java Examples - Find the last occurrence of the string
  3. Java example - to delete a character string
  4. Java Examples - string replacement
  5. Java example - to reverse a string
  6. Java Examples - string search
  7. Java examples - split string
  8. Java Examples - turn uppercase lowercase string
  9. Java Examples - Tests if two string regions are equal
  10. Java Examples - string performance comparison test
  11. Java Examples - string Optimization
  12. Java Examples - string formatting
  13. Java instances - the connection string

Java arrays

  1. Java Examples - sorted array elements and Find
  2. Java Examples - Adds elements
  3. Java Examples - Get array length
  4. Java instances - array reverse
  5. Java instances - array output
  6. Java instances - array for maximum and minimum
  7. Java instances - array merge
  8. Java instances - array filling
  9. Java instances - array expansion
  10. Java Examples - Finding and Sorting an array
  11. Java Examples - delete array element
  12. Java instances - array difference set
  13. Java example - the intersection of arrays
  14. Java instance - to find the specified element in the array
  15. Java instance - to determine whether the same array
  16. Java instances - array and set

Java processing time

  1. Java Examples - Formatting time (SimpleDateFormat)
  2. Java Examples - Get current time
  3. Java instances - get year, month, etc.
  4. Java Examples - timestamps converted into time

Java method

  1. Java Examples - Method overloading
  2. Java example - the output of the array elements
  3. Java Examples - Tower of Hanoi algorithm
  4. Java example - Fibonacci number
  5. Java Examples - factorial
  6. Java example - cover method
  7. Java Examples - instanceOf Keyword Usage
  8. Java Examples - break Keyword Usage
  9. Java instance - continue Keyword Usage
  10. Java Examples - Label (Label)
  11. Java Examples - enum and switch statement
  12. Use Enum (enum) constructor and methods - Java Examples
  13. Java instances - for use with foreach loop
  14. Java Examples - Varargs variable parameters
  15. Java Examples - Overload (overloading) used in the method Varargs

Java file operations

  1. Java example - files are written
  2. Java Examples - read the file contents
  3. Java Examples - delete files
  4. Java example - copy the file to another file
  5. Java Examples - append data to the file
  6. Java example - create a temporary file
  7. Java example - to modify the file last modified date
  8. Java Examples - Get File Size
  9. Java example - file renaming
  10. Java example - set the file read-only
  11. Java example - to detect whether a file exists
  12. Java instances - to create a file in the specified directory
  13. Java Examples - Get file modification time
  14. Java Example - Create a file
  15. Java example - file path comparison

Java directory operations

  1. Java Examples - recursively create directory
  2. Java example - delete a directory
  3. Java example - to determine whether the directory is empty
  4. Java example - to determine whether the file is hidden
  5. Java instances - get directory size
  6. Java Examples - find files in the specified directory
  7. Java Examples - Get parent directory files
  8. Java instances - get directory last modified time
  9. Java examples - Print directory structure
  10. Java Examples - all directories under the specified directory traversal
  11. All files in the specified directory traversal - Java Examples
  12. Java Examples - find files in the specified directory
  13. Java instance - the system root directory traversal
  14. Java instance - to view the current working directory
  15. Java instance - directory traversal

Java exception handling

  1. Java Examples - exception handling
  2. Java Examples - Multiple exception handling (multiple catch)
  3. Java Examples - Finally Usage
  4. Java instance - use catch to handle exceptions
  5. Java Examples - multithreading exception handling
  6. Java Examples - Get the exception stack information
  7. Java Examples - overloaded methods Exception Handling
  8. Java Examples - chain test abnormal
  9. Java Examples - custom exception

Java Data Structure

  1. Java Examples - Digital summation
  2. Java examples - use the stack to convert the infix expression into a suffix
  3. Java Examples - beginning of the list (LinkedList) and junction
  4. Java Examples - Get list (LinkedList) first
  5. Java example - to delete the list of elements
  6. Java Examples - Get the list of elements
  7. Java Examples - Get vector element index value
  8. Java Examples - stack implementation
  9. Java Examples - Finding list elements
  10. Java Examples - stack method to achieve a push to reverse a string
  11. Java Examples - queue (Queue) Usage
  12. Java Examples - Get the maximum element of a vector
  13. Java example - to modify the list
  14. Java Examples - rotation vector

Java collections

  1. Java instances - array to a collection
  2. Java Examples - Compare collections
  3. Java Examples - HashMap traversal
  4. Java example - set length
  5. Java Examples - set shuffled
  6. Java example - set traversal
  7. Java example - set reverse
  8. Java example - delete the specified element in the collection
  9. Java Examples - read-only collection
  10. Java Examples - collective output
  11. Java Examples - set switch array
  12. Java Examples - List circulating movement elements
  13. Java Examples - minimum and maximum values in the Find List
  14. Java Examples - Traverse HashTable keys
  15. Java Examples - Using Enumeration traverse HashTable
  16. Java examples - add the collection of different types of elements
  17. Java Examples - Replacement List elements
  18. Java Examples - List interception

Java Network Example

  1. Java Examples - Get the IP address of the specified host
  2. Java Examples - Check whether the port has been used
  3. Java Examples - access to the local ip address and host name
  4. Java Examples - Get Remote File Size
  5. Java Examples - Socket multi-threaded server program
  6. Java instances - view the host specified file was last modified
  7. Java instance - to connect to the specified host using Socket
  8. Java Examples - Web Crawl
  9. Java Examples - Get URL response header date information
  10. Java Examples - Get URL response headers
  11. Java Examples - Analysis URL
  12. Java Examples - ServerSocket and Socket communications examples

Java threads

  1. Java Examples - Check the thread is alive
  2. Java Examples - Get the name of the current thread
  3. Java Examples - Condition Monitoring
  4. Java instances - the thread priority settings
  5. Java Examples - Deadlock and Solution
  6. Java instances - get thread id
  7. Java Examples - thread suspension
  8. Java Examples - terminate the thread
  9. Java Examples - producer / consumer problem
  10. Java Examples - Condition Monitoring
  11. Java instances - the thread priority settings
  12. Java Examples - Deadlock and Solution
  13. Java Examples - Get thread state
  14. Java Examples - Get all threads
  15. Java Examples - View thread priority
  16. Java Examples - interrupt thread