The content of this interview question is that two threads are required to print alternately and print out " 12a34b56c78d910e1112f1314g1516h1718i1920j2122k2324l2526m2728n2930o3132p3334q3536r3738s3940t4142u4344v4546w4748x4950y5152z "。
One thread
Package pkg;
/** * Created by Sanmao on 2016/6/29. * * public class Static {/** * from the previous blog with restricted wildcard characters, we see that the Totalarea method is a generic method because it can receive different parameters * But
Enter the number of students: 2 Enter the number of courses: 3 Please define the 1th course: Data structure Define the 2nd course: Operating system Please define the 3 course: Composition principle Please enter the 1th student name: W
Wrote a simple FTP client, this client mainly uses the FtpClient class, this class is in the JDK Lib/rt.jar package. Now realize the file upload, folder upload. The rest of the functionality needs to be supplemented.
The code is as follows:
Import
It programmer development must-all kinds of resources download list, the most complete IT resources in history, personal collection summary.
The process and considerations for deploying Java Web Projects with Tomcat under Linux (original)
I.
Company class
public class Company {
employee[] Employee;
Double salaries=0;
Company (employee[] Employee) {
this.employee=employee
}
Public double Salariedpay () {
salaries=0;
for (int i=0;i
Companysalary class
public class Companysalary
Package Com.test_java;
Import Java.util.Arrays;
public class Prime {* * * * * * * * To find the prime number within n/int n;
int i,j; Prime (int inputn) {this.
N = inputn;
//Normal Trial Division private void Comprime1_1 ()
Some of the commonly used string functions in Java are recorded for later use.
1 java.lang.string-->substring (int indexid)/string substring (int beginidex,int endindex)Get substring: "Unhappy". Substring (2)--> "Happy" (intercept string from
For a simple simulation of the Spring framework:
a). reading XML configuration file
B.) Using Java reflection mechanism to get objects
Step one: Create an interface, define a method to get the object Getbean ():
Public interface Beanfactory
1. Exceptions in the program(1) in the process of running the program, the accident occurred, deviation from the intention of our program itself, can be understood as abnormal.(2) Using the exception mechanism in Java, we can improve the robustness
Like we often encounter such things, such as a TXT file with a name and telephone, this time very often need to be the name and phone number to extract operations, this time can be used in Java IO to achieve. Here I do not specifically introduce IO
The road to Java Web development-some tips for getting startedJava is a pleasant thing to do with web development.You will say I am talking in my sleep, hehe ~ ' Slowly come on ~
-* The following are personal opinions, just a comment, no copyright,
The Java main thread waits for all child threads to finish executing. In fact, in our work is often used, such as the main thread to return a response to the user's value, but the value of the assignment process is done by the child thread
1, the serialization is what. This is simply to save the state of the various objects in memory, and to read the saved object state again.
Although you can save object States in a variety of ways, Java provides you with a mechanism to preserve the
On the code:import Java.text.simpledateformat;import java.util.Date; Public classDateutil {/** * Timestamp converted into a date format string * @param seconds exact to the second string * @param formatstr * @return*/ Public Staticstring
Covariance and Contravariance in JavaLet's start with the concept of covariance, contravariance and invariant in Java.The official argument is that the inversion and covariance describe the inheritance relationship after the type conversion.Defines
JVM memory structures such as
The Java heap, which is the largest piece of memory managed by a Java virtual machine. The Java heap is a piece of memory that is shared by all threads and created when the virtual machine is started. The only
1. Static initialization block Static initialization blocks are only executed once when the class is first loaded , while static initialization blocks can only assign values to static variables and cannot be assigned to normal member variables.2.
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