Read about core java programming interview questions, The latest news, videos, and discussion topics about core java programming interview questions from alibabacloud.com
Multithreading and concurrency issues are among the questions that interviewers prefer to ask in a Java technology interview. Here, the most important questions are listed from the interview point of view, but you should still have a solid grasp of the basics of
115 Java Interview Questions and answers-ultimate list (I), 115 java
Object-Oriented Programming (OOP)
Java is a computer programming language that supports concurrency, class-based,
) Select the correct collection type as needed. For example, if you specify a size, we will choose an array instead of a ArrayList. If we want to traverse a map in order of insertion, we need to use TreeMap. If we don't want to repeat, we should use set.(2) Some collection classes allow you to specify the initial capacity, so if we can estimate the number of stored elements, we could use it to avoid re-hashing or resizing.(3) programming based on inte
TreeMap. If we don't want to repeat, we should use set.(2) Some collection classes allow you to specify the initial capacity, so if we can estimate the number of stored elements, we could use it to avoid re-hashing or resizing.(3) programming based on interfaces, rather than implementation-based programming, allows us to easily change the implementation later.(4) Always use type-safe generics to avoid clas
Java interview question Summary 2 (Continuous updates), java questions
1. How to format a date
Answer:Date now = new Date ();
SimpleDateFormat sdf = new SimpleDateFormat ("yyyy-MM-dd hh: mm: ss ");
String formatNow = sdf. format (now );
The formatNow variable is the formatted date.
2. What are several implementation m
programming, details of the Java inside and the contract, thread pool to achieve the principle of what it looks like
Øjava reflex have you ever learned that Java annotations have ever understood
Ø What is the difference between TCP and IP protocol, if we want to communicate with other companies, please design a communication solution
O have any
Newcachedthreadpool creates multithreading.NewscheduledthreadpoolThis thread pool can specify a fixed number of threads to be executed periodically. For example, by scheduleatfixedrate or Schedulewithfixeddelay to specify the cycle time.PS: In addition to write timed tasks (if not Quartz framework), it is best to use this thread pool to do, because it can ensure that there is always a live thread.Recommended way to use ThreadpoolexecutorIn the case of Ali's
after the real object is called.Proxy mode,The proxy class and the proxy class implement the same interfaceAn instance of a proxy class in a proxy classBehavioral patterns: Focus on communication between objectsSuch as: Responsibility chain mode, iterator mode, command modeResponsibility chain ModelSimilar interceptors, etc.Command mode:Separates callers from Callee's behaviorInterpreter mode:Each syntax is an interpreter classIterator mode:Change the collection class's view traversal and add a
wrapper type , which means that the wrapper type can be converted directly to the base data type , as shown in the following code:int m=100; Integer im=int N=im; The appeal code directly assigns m to the wrapper object IM, which is automatically boxed and then directly assigns the IM to the basic data type N, which is the automatic unpacking. Although the code on the surface is simple and convenient, however, in essence, the container still uses new to create the object, while unpacking is s
dispatch and dispatch, and a smaller unit that can run independently than a process. Thread's StrokeThe sub-scale is less than the process, which makes the multi-threaded procedure highly concurrency, and the process typically has independent memory units at execution time, while the threads can share memory. Programming with multithreading often leads to better performance and user experience,But multithreaded programs are unfriendly to other progra
Java programmer interview questions (86-115)
86. In Struts 2, how does Action obtain the data that the user inputs from the page, and how does it transmit its own data to the view?
A: There are three ways for Action to retrieve data from the page:
1) accept parameters through the Action attribute
2) obtain parameters through the domain model
3) ModelDriven
)
First, let's talk about the differences between final, finally, and finalize. Second, can anonymous inner class (anonymous internal class) be extends (inherited) other classes, or implements (implemented) interface (Interface )? Third, the difference between static nested class and inner class is that the more you say, the better (the more general the interview questions are ). Fourth, the difference bet
difference between stack and stack.
The storage method is shown in:
Image Source
To be continued .....
Java FAQ
Download a java interview book online with comprehensive questions.What are the correct answers to common Java programming
I used to have only one Java interview question topic. Now I have divided into the following topics:
Java interview questions are of course the focus, all of which are Java programming
separately, which belongs to the salvage function operation.Interview question: Please explain the difference between ArrayList and Vector.· These two classes are subclasses of the List interface;· The Vector class is provided at JDK 1.0, and the method of operation provided is synchronous, so it is thread-safeThe Operation class;· The ArrayList class is provided at JDK 1.2, and the method provided is asynchronous, so it belongs to the non-linearProcess-safe Operation classes.If later in develo
In the Java Pure Grammar interview, mainly encountered some of the basic interview questions, summarized here!First, to talk about final, finally, finalize the difference. final-modifier (keyword) If a class is declared final, it means that it can no longer derive a new subclass and cannot be inherited as a parent c
Java interview questions: Implementation of stacks and queues
During the interview, stacks and queues are often checked in pairs. This article includes the following stack and queue test content:
1) stack Creation
2) create a queue
3) Two stacks implement one queue
4) two queues implement one stack
5) design the stack
After JDK5, Java provides a more convenient security mechanism that uses lock locks for thread-locked operations and release operations without using synchronized . More clear. Example:Lock lock=new Reentrantlock ();Lock.lockCode that needs to be lockedLock.unlockWhy is lock more secure? Because synchronized may cause deadlock phenomenon, specifically about the deadlock phenomenon can refer to the operating system, there is no more to say.Summarize th
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.