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
- Java examples - how to build a Java file?
- Examples of Java - Java how to run a compiled class files?
- Java example - how to perform the specified class file directory (classpath)?
- Java examples - how to view the current version of Java running?
Java string
- Java Examples - string comparison
- Java Examples - Find the last occurrence of the string
- Java example - to delete a character string
- Java Examples - string replacement
- Java example - to reverse a string
- Java Examples - string search
- Java examples - split string
- Java Examples - turn uppercase lowercase string
- Java Examples - Tests if two string regions are equal
- Java Examples - string performance comparison test
- Java Examples - string Optimization
- Java Examples - string formatting
- Java instances - the connection string
Java arrays
- Java Examples - sorted array elements and Find
- Java Examples - Adds elements
- Java Examples - Get array length
- Java instances - array reverse
- Java instances - array output
- Java instances - array for maximum and minimum
- Java instances - array merge
- Java instances - array filling
- Java instances - array expansion
- Java Examples - Finding and Sorting an array
- Java Examples - delete array element
- Java instances - array difference set
- Java example - the intersection of arrays
- Java instance - to find the specified element in the array
- Java instance - to determine whether the same array
- Java instances - array and set
Java processing time
- Java Examples - Formatting time (SimpleDateFormat)
- Java Examples - Get current time
- Java instances - get year, month, etc.
- Java Examples - timestamps converted into time
Java method
- Java Examples - Method overloading
- Java example - the output of the array elements
- Java Examples - Tower of Hanoi algorithm
- Java example - Fibonacci number
- Java Examples - factorial
- Java example - cover method
- Java Examples - instanceOf Keyword Usage
- Java Examples - break Keyword Usage
- Java instance - continue Keyword Usage
- Java Examples - Label (Label)
- Java Examples - enum and switch statement
- Use Enum (enum) constructor and methods - Java Examples
- Java instances - for use with foreach loop
- Java Examples - Varargs variable parameters
- Java Examples - Overload (overloading) used in the method Varargs
Java file operations
- Java example - files are written
- Java Examples - read the file contents
- Java Examples - delete files
- Java example - copy the file to another file
- Java Examples - append data to the file
- Java example - create a temporary file
- Java example - to modify the file last modified date
- Java Examples - Get File Size
- Java example - file renaming
- Java example - set the file read-only
- Java example - to detect whether a file exists
- Java instances - to create a file in the specified directory
- Java Examples - Get file modification time
- Java Example - Create a file
- Java example - file path comparison
Java directory operations
- Java Examples - recursively create directory
- Java example - delete a directory
- Java example - to determine whether the directory is empty
- Java example - to determine whether the file is hidden
- Java instances - get directory size
- Java Examples - find files in the specified directory
- Java Examples - Get parent directory files
- Java instances - get directory last modified time
- Java examples - Print directory structure
- Java Examples - all directories under the specified directory traversal
- All files in the specified directory traversal - Java Examples
- Java Examples - find files in the specified directory
- Java instance - the system root directory traversal
- Java instance - to view the current working directory
- Java instance - directory traversal
Java exception handling
- Java Examples - exception handling
- Java Examples - Multiple exception handling (multiple catch)
- Java Examples - Finally Usage
- Java instance - use catch to handle exceptions
- Java Examples - multithreading exception handling
- Java Examples - Get the exception stack information
- Java Examples - overloaded methods Exception Handling
- Java Examples - chain test abnormal
- Java Examples - custom exception
Java Data Structure
- Java Examples - Digital summation
- Java examples - use the stack to convert the infix expression into a suffix
- Java Examples - beginning of the list (LinkedList) and junction
- Java Examples - Get list (LinkedList) first
- Java example - to delete the list of elements
- Java Examples - Get the list of elements
- Java Examples - Get vector element index value
- Java Examples - stack implementation
- Java Examples - Finding list elements
- Java Examples - stack method to achieve a push to reverse a string
- Java Examples - queue (Queue) Usage
- Java Examples - Get the maximum element of a vector
- Java example - to modify the list
- Java Examples - rotation vector
Java collections
- Java instances - array to a collection
- Java Examples - Compare collections
- Java Examples - HashMap traversal
- Java example - set length
- Java Examples - set shuffled
- Java example - set traversal
- Java example - set reverse
- Java example - delete the specified element in the collection
- Java Examples - read-only collection
- Java Examples - collective output
- Java Examples - set switch array
- Java Examples - List circulating movement elements
- Java Examples - minimum and maximum values in the Find List
- Java Examples - Traverse HashTable keys
- Java Examples - Using Enumeration traverse HashTable
- Java examples - add the collection of different types of elements
- Java Examples - Replacement List elements
- Java Examples - List interception
Java Network Example
- Java Examples - Get the IP address of the specified host
- Java Examples - Check whether the port has been used
- Java Examples - access to the local ip address and host name
- Java Examples - Get Remote File Size
- Java Examples - Socket multi-threaded server program
- Java instances - view the host specified file was last modified
- Java instance - to connect to the specified host using Socket
- Java Examples - Web Crawl
- Java Examples - Get URL response header date information
- Java Examples - Get URL response headers
- Java Examples - Analysis URL
- Java Examples - ServerSocket and Socket communications examples
Java threads
- Java Examples - Check the thread is alive
- Java Examples - Get the name of the current thread
- Java Examples - Condition Monitoring
- Java instances - the thread priority settings
- Java Examples - Deadlock and Solution
- Java instances - get thread id
- Java Examples - thread suspension
- Java Examples - terminate the thread
- Java Examples - producer / consumer problem
- Java Examples - Condition Monitoring
- Java instances - the thread priority settings
- Java Examples - Deadlock and Solution
- Java Examples - Get thread state
- Java Examples - Get all threads
- Java Examples - View thread priority
- Java Examples - interrupt thread