java interview questions and answers

Discover java interview questions and answers, include the articles, news, trends, analysis and practical advice about java interview questions and answers on alibabacloud.com

Java interview questions (86-115)

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 )

Java multithreading interview questions Induction

Java multithreading interview questions Induction1. What are the implementation methods for multithreading? The following example shows the thread synchronization. (1) Java multithreading has two implementation methods: Inheriting the Thread class and implementing the Runnable interface. Thread implements the Runnable

Java Collection framework grooming (with classic interview questions)

. At the same time if there are multiple threads accessing Hashmap,collections.synchronizedmap () can be substituted, generally hashmap more flexible.10. Why is the vector considered to be obsolete or unofficially deprecated? Or why we should always use ArrayList instead of vectors.You should use ArrayList instead of vectors because by default you are non-synchronous, vectors synchronize each method, you almost never do that, and usually you want to synchronize the entire sequence of operations.

Some finishing questions about the Beginner Java interview (partially transferred from others)

values that cannot be changed. The string provided by this StringBuffer class is modified. You can use StringBuffer when you know that character data is going to change. Typically, you can use Stringbuffers to dynamically construct character data.5. What are the similarities and differences between abnormal operation and general anomaly?An exception represents an unhealthy state that may occur during a program's run, and a run-time exception that represents an exception that may be encountered

"--java" Interview questions (2)

are characterized by the inability to define variables, and all methods are abstract methods . abstract classes can have variables and do not enforce the need for abstract methods .Inheritance of class 16 and implementation of interfacesParsing: Class Inheriting the parent class implements the interface with the class, which is essentially the same. is to either extend or rewrite the parent class or interface as a template on this template. In practical programming, programmers often need to in

Java Developer written interview 12 questions per day (2)

, and future to implement threads with return resultsThe Executorservice, callable, and future three interfaces are actually executor frameworks. The thread that returns the result is a new feature introduced in the JDK1.5, and with this feature it is no longer necessary to get the return value. And it can be flawed if it is achieved.A task that can return a value must implement the callable interface. Similarly, a task without a return value must implement the Runnable interface.After performin

Sword refers to Java Implementation of offer programming questions -- interview question 4 replaces spaces, and sword refers to offer

Sword refers to Java Implementation of offer programming questions -- interview question 4 replaces spaces, and sword refers to offerImplement a function to replace spaces in a string with "% 20 ". For example, if the string is We Are Happy, the replaced string is We % 20Are % 20 Happy. 1 package Solution; 2 3/** 4 * offoffoffer

Analysis and Summary of Baidu Java R & D interview questions

Analysis and Summary of Baidu Java R D interview questions 1. Analysis of Common application scenarios in singleton mode. Among the 23 design modes, the singleton mode is the largest. It is easy to understand, but applicable to scenarios. Are you really familiar with this? The use of Singleton is because there is no need to create an object for each request, wh

Java Interview questions

One: The difference between Eclipse and MyEclipseA: 1 common: Both are used to develop Java projects, and software usage is almost identical2 MyEclipse is a fee-free software, which can develop both Java and Web projects, Eclipse can only develop Java projects, if you want to develop a Web project, but also need to add additional Eclipse Web plug-in (of course, c

Java Mock interview questions

default branch, which must be the last branch of a switch statement. (3) default is executed when no case statement is equal to the value of the variable. The default branch does not require a break statement.Break is used to interrupt the loop statement, and continue is used to continue the loop. Breake break out of the loop body, continue continue the next loop, but the statement after continue is not running. Continue can only be used in loop statements, and break may be used in other branch

As a Java programmer who is often asked in an interview, let me summarize some of the questions that I often don't ask. __java

As a Java programmer who is often asked in an interview, let me summarize some of the questions that I often don't ask. The difference between 1.HashMap and Hashtable Often asked. Both are classes of the map interface, which enable you to map a unique key to a specific value. HashMap class is not sorted and can have a null key and multiple nul

Java Algorithm interview questions: Write a Singleton, javasingleton

Java Algorithm interview questions: Write a Singleton, javasingleton Package com. swift; public class Singleton {public static void main (String [] args) {/** write a Singleton */ORC_Hungry.getOrc (). fun (); ORC_Lazy.getOrc (). fun () ;}} class ORC_Hungry {// hungry Chinese private static ORC_Hungry orc = new ORC_Hungry (); private ORC_Hungry () {} public stati

Get to know java-15.7 Map from scratch (4)-Introduction to how HashMap works-hash collisions (often as interview questions)

longer executed.(2) But in the case of a hash collision, the first two conditions are established, and then the last equals must be used to determine the equality of the objects.A 3.hash collision scene?(1) Generally appears in large data situations(2) The generation method of Hashcode is weak (such as the artificial production hashcode above)Summary: This chapter mainly through the introduction of hash collision once again in-depth understanding of hashmap work principle.This chapter is here,

Java interview Frequently asked Questions

1. The difference between String and StringBufferThe Java platform provides two classes: string and StringBuffer, which can store and manipulate strings, That is, character data that contains more than one character. This string class provides values that cannot be changed strings and the strings provided by this StringBuffer class are modified when you know that character data is going to change, you can use StringBuffer typically, You can use Stri

Difference between Forward and Redirect in common JAVA interview questions, forwardredirect

Difference between Forward and Redirect in common JAVA interview questions, forwardredirect The user sends an HTTP request to the server, which may be returned to the user after being processed by multiple information resources. Each information resource uses the request forwarding mechanism to forward requests to each other, however, the user does not feel reque

2-year Java interview questions summary

The resume has some Ajax and struts issues.Growth strategy for database primary keyThe type of struts?Why use the difference between struts;session and cookies,Introduction to AjaxWhat are the built-in objects for 1.jsp?Four scopes for 2.jsp3. "". What is the difference between equals A and A.equals ("")?What is the difference between get and post for a 4.form form submission?What is the difference between 5.Cookie and session?How do 6.mysql and Oracle's primary keys come into being?7. Why use S

Java Interview Algorithm questions

position, filling the original AI (i), the AI value inserted into the space after the shift of J * * This implementation of a card from I, inserted into the exact position. Loop through the process sequentially, and each element of the loop is eventually inserted into the position it should be in, thus sorting is achieved. * [1, 2, 4, 5, 6, 7, 9, 3, 8] * [1, 2, 3, 4, 5, 6 , 7, 9, 8] * @param array * @param up */Public static void Insertsort (Int[] Array, Boolean up) {for

A collection framework for Java Fundamentals Enhancement Note 29: Collection code for implementing stack data structures using LinkedList (interview questions)

(); - } - - Public BooleanIsEmpty () {///Bottom call is LinkedList's IsEmpty () method to determine if the set internal data is empty - returnlink.isempty (); in } -}(2) test of Mystack:1 Packagecn.itcast_05;2 3 /*4 * Test of Mystack5 */6 Public classMystackdemo {7 Public Static voidMain (string[] args) {8 //To create a collection object9Mystack ms =NewMystack ();Ten One //adding elements AMs.add ("Hello"); -Ms.add ("World"); -Ms.add ("

Frequently asked database questions in the Java interview

rewrite the aof file, the performance impact of this persistence is minimal, but the aof file will continue to grow, aof file over the General Assembly to affect the recovery speed of master restart. Master should not do any persistent work, including memory snapshots and aof log files, in particular, do not enable memory snapshots to persist, if the data is more critical, a slave open aof backup data, the policy is synchronized once per second. Master calls bgrewriteaof rewrite aof file, a

Java interview-Classic algorithm questions

many occurrences in the array are greater than half @Test public void Test () {int[] num = {1,2,2,2,2,2,2,4,2,4,6,4,2,6,8,2,7,7}; SYSTEM.OUT.PRINTLN (Morethanhaft (num)); } public int morethanhaft (int[] num) {int result =-1; int times = 0, for (int i=0;iTopic Eight:Determines whether an array is the stacking order of another stack @Test public void Test () {int[] num = {1,2,3,4,5};//int[] num1={1,2,3,5,4}; int[] num2={2,1,5,3 , 4}; stackTopic Nine:Draw 5 cards from poker, 0

Total Pages: 15 1 .... 11 12 13 14 15 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.