java interview questions

Read about java interview questions, The latest news, videos, and discussion topics about java interview questions from alibabacloud.com

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 ("

Java Multithreading and Concurrency basics interview questions and Answers

multithreaded programs, multiple threads are executed concurrently to improve the efficiency of the program, and the CPU does not go idle because a thread needs to wait for resources. Multiple threads share heap memory, so creating multiple threads to perform some tasks is better than creating multiple processes. For example, Servlets is better than CGI because Servlets supports multithreading and CGI does not support it.How does the volatile keyword work in

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

Java interview programming questions

Today, I found the java interview programming questions in the Forum and thought about it. I found that I forgot my original programming basics. Question: How many equals 2x8 in the most efficient way? Along with the targeted thinking, I thought of 2x8. Later I thought that this efficiency was definitely not the best. think of the concept of a computer system,

Java Interview Common Questions

1. String S1 = ' 123 ';String s2 = new string ();2. The difference between two ways of implementing multithreadingInheriting the thread and implementing the Runnable interface3. Single-column design mode What's the difference between lazy and a hungry man? * * *Lazy style Features: lazy loading. Delayed loading in multi-threaded security problems, through the addition of synchronization to solve, plus synchronization efficiency is low, with a double-judge method to solve the low efficiency. The

Java Custom Generic interview questions: receive arbitrary arrays for inversion

You can only manipulate a type to invert without a generic typeThe code is as follows: Packagecom.swift.fanxing;Importorg.junit.Test; Public classRenyireverse {@Test Public voidTest () {intarr[]=New int[] {1,10,6,9,2}; Reverse (arr); } Public voidReverseint[] arr) { for(inti=0;i) { inttemp=Arr[i]; Arr[i]=arr[arr.length-1-i]; Arr[arr.length-1-i]=temp; } for(intX:arr) {System.out.println (x); } }}Generic functionality can

Interview Questions-java basics-Object oriented parts

methods.A class can implement many interfaces, but only one abstract class is inheritedClasses can not implement all methods of abstract classes and interface declarations, and of course, in this case, the class must also be declared abstract.An abstract class can implement an interface without providing an interface method implementation.The variables declared in the Java interface are final by default. An abstract class can contain non-final variab

This is one of the most useful Java interview questions I've ever seen, interviewing countless companies summarizing

"Declaration" Source: Power node Java Institute, reprint Source: Script House (The answer to a small number of questions was slightly altered by me) 1, what is the thread local variable. A thread-local variable is a variable within the thread itself, owned by the thread itself, and not shared among multiple threads. Java provides a ThreadLocal class to support t

[Black Horse programmer Java training and Android training] interview questions (1)

I was also reading the interview book while learning the video. The record is as follows: 1. LostAfter learning the 2010java high-tech video from Teacher Zhang Xiaoxiang for so many days, he looked at generics, reflection and other things and turned his mind away. He just learned that none of the Main Lines dragged me. That is to say, I am eager to know what major technologies will be required for future development and what is the core of

Frenquently asked interview questions Java

Java Questions Answers 1. What is the difference between an applet and an application? A Java application is made up of a main () method declared as public static void that accepts a string array argument, along with any other classes that main () CILS. it lives in the environment that the Host OS provides. A Java a

Java interview questions (1)

This is the topic discussed during the last interview and is recorded.Spring Why use Spring? What are the benefits of IoC? What are the benefits of scalability? How to instantiate a Bean? What is the difference between ApplicationContext and BeanFactory? How can I read external files through Spring? Can Bean IDS be repeated in the Spring configuration file? What is automatic assembly and type check in Spring? Can ApplicationContext be loaded

Android/Java interview questions-you may not understand it!

1. What is acitsag startup mode? For such a question, I will write an example myself. I will observe it to understand it. Activty supports four startup modes. Launchmode: Standard: each time a new activity window is started (New Operation) Singletop: if it is a target activity at the top of the stack, It will be opened directly. Otherwise, a new activity window (new) will be opened ). Singletask and singleinstance are basically the same. The difference is that if the root activity is set to sing

Java resource sharing, interview questions data, distributed big Data

Horse Soldier Big Data Architect (1)Link: http://pan.baidu.com/s/1qYTW1m0 Password: LXJDSpring CloudLink: Http://pan.baidu.com/s/1bzG9vK Password: zy2bLink: Http://pan.baidu.com/s/1qXF3eGG Password: 19u9Design and practice of micro-service architectureLink: Http://pan.baidu.com/s/1slNiP5N Password: u6euBEIJING-PK Education Linux Big Data video sharingLink: http://pan.baidu.com/s/1c2Aci6c Password: m7bnStill Academy ~ Internet architect CompleteLink: http://pan.baidu.com/s/1mhJFca0 Password: 25at

Java interview in the "rival" thread, 9 questions comprehensive analysis

executing the Wait,sleep,join method will throw interruptedexception, if the normal state, we can through isinterrupted () =true, To stop the thread from using the return method.(vii) Start and run methods for threadsNote that for a thread to run, only the Start method is executed, this method is the native method, the Run method is where we define the task, and a separate call to the Run method is the same as invoking the normal method. The Start method can only be called once, and more than o

Java interview questions (1)

This is the topic discussed during the last interview and is recorded. Spring Why use spring? What are the benefits of IOC? What are the benefits of scalability? How to instantiate a bean? What is the difference between applicationcontext and beanfactory? How can I read external files through spring? Can bean IDS be repeated in the spring configuration file? What is automatic assembly and type check in spring? Can applicationco

Ali JAVA Development Interview Frequently asked questions summary __java

and attribute value), and information about the server (by passing a ServletContext object)1, with 1-5 working experience, in the face of the current popular technology do not know where to start, the need to break through the technical bottlenecks can add group.2, in the company for a long time, live very comfortable, but job-hopping when the interview hit the Wall. Need to study in a short time, job-hopping to get high salaries can add group.3, if

Interview questions (Java section)

Controller: When the user clicks the Submit button in the Web page, the controller accepts the request and invokes the appropriate model to process the request. The corresponding view is then called according to the result of the processing to display the results of the processing. MVC process: First the controller accepts the user's request, invokes the corresponding model for business processing, and returns the data to the controller. The controller invokes the corresponding view to

Java Fundamentals Hardening 82:math Class Random () method to obtain arbitrary range of randomly-number cases (interview questions)

(intx = 0; x ) { - //Invoke function - intnum =getrandom (start, end); - //Output Results - System.out.println (num); in } - } to + /* - * Write a function two explicit: return value type: int argument list: int Start,int end the */ * Public Static intGetrandom (intStartintend) { $ //think back to the random numbers we talked about between 1-100.Panax Notoginseng //int number = (int) (Math.random () * +) + 1;//(int) (Math.r

Java Programmer Interview 32 questions

. 28th, Programming question: Calculate 2 times 8 in the most efficient way? Programmers with a C background are particularly interested in asking such questions. 2 29th, two object values are the same (x.equals (y) = = true), but can have different hash code, this sentence is correct? No, there's the same hash code. 30th, when an object is passed as a parameter to a method, this method can change the property of the object and return the result

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