java sample programs for interview

Want to know java sample programs for interview? we have a huge selection of java sample programs for interview information on alibabacloud.com

Java interview Some code-writing topics

Give a string, replace more than two _ to one, such as "Hello__world____are__you_ok?", should be treated as "Hello_world_are_you_ok?", the sample code is as follows: Using regular expressions, a word-out version:public static void Main (string args[]) {string str= "Hello__world____are__you_ok?";System.out.println (Str.replaceall ("[_]+", "_")); } Output: Hello_world_are_you_ok?The more troublesome version:public static string replace (String str)

Java Multithreading Introduction Knowledge and sample program _java

Why do I need multiple threads?Simplification of the model, such as some programs are run by a number of relatively independent tasks: The appearance of graphical interface, the blocking of input and output Multi-core CPU for better utilization The need for asynchronous behavior Java Multi-Threading features: The entry of the program main itself is a thread Threads are concurrent, unordered execution

Java implementation of serial communication sample

Using Java to implement serial communication (under Windows System), we need to use the port package Javacomm20-win32.zip provided by Sun. There are three files to use, such as the following configuration:1.comm.jar placed to Java_home/jre/lib/ext;2.win32com.dll placed to Java_home/bin;3.javax.comm.properties two places to put them.Jre/lib (that is, the JRE in the Java directory)Java_home/jre/libTell me abo

Total Pages: 8 1 .... 4 5 6 7 8 Go to: Go

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.