common java interview questions

Want to know common java interview questions? we have a huge selection of common java interview questions information on alibabacloud.com

The six most common Java computing questions are:

The six most common Java computing questions are: 1. 3 white balls 3 Red Balls 6 black balls random 8 balls, calculate all results Public class Ball {public static void main (String [] args) {int a = 3, B = 3, c = 6, I = 0; for (int x = 0; x 2. Digital pyramid public class Pyramid { public static void main(String args[]){ for (int i=1; i 3. Check whether the d

Java String Common operation questions

]); sb.reverse (); sb2.append (sb) ;if(i = = ss.length-1) {sb2.append (".");}Else{sb2.append (" ");}} System. out. println (sb2);}6.String s= "name=zhangsan age=18 classno=090728";The above string is split and the result is as Follows:Zhangsan 18 090728 public Static voidmain (string[] Args) {String s="Name=zhangsan age=18 classno=090728"; string[] SS= S.split (" "); StringBuffer SB=NewStringBuffer (); for(inti =0; I ) {string[] SS2=ss[i].split ("="); Sb.append (ss2[1]); Sb.append (" "); } Sys

Interview preparation series 03 ---- Summary of Binary Tree questions in the interview

Interview preparation series 03 ---- Summary of Binary Tree questions in the interview Interview preparation series 03 ---- Summary of Binary Tree questions in the interview This article is the first article in the

Java Common pen Questions < two >

1. Output order of static code block, non-static code block, constructor functionCase one: When the parent class is not inherited1 classHelloa {2 3 PublicHelloa () {4System.out.println ("I ' M A class");5 }6 7 Static {8System.out.println ("Static A");9 }Ten One { ASystem.out.println ("A"); - } - the Public Static voidMain (string[] args) { - NewHelloa (); - NewHelloa (); - } +}Output Result:Static AAI ' M A classAI ' M A classAnalysis:

Java Common Algorithm Questions (18)

packagecom.xiaowu.demo;/*** Two table tennis team to play, each out three People. Team A for A,b,c three, team B for the x, y, z three, with lots to decide the contest List. Someone asked the team about the game List: A said he did not compare with x, C said he did not and x, * Z ratio. Please compile the procedure to find out the list of the three Teams. * * @authorWQ **/ public classDemo18 { public Static voidmain (string[] Args) {vs (); } public Static voidvs () {Char[] m = {' a ', ' b '

Common face questions in Java

1. The difference between sleep () and wait ():Both can control the linear process and block the Process. The difference is:-----|sleep (): frees the CPU and does not release resources (locks). You can make it automatically wake up by specifying a time, but only by calling Iterreput () to force the interrupt;-----|wait (): frees the CPU and frees up resources (locks). Must be used in the context of a lock, that is, synchronous code block, synchronous method, when used: lock. wait ();

Java Common algorithm questions (20)

PackageCom.xiaowu.demo;/*** * Print out the case (diamond) * * * *@authorWQ **/ Public classDemo20 { Public Static voidMain (string[] args) {display (5); } Public Static voidDisplayinth) { for(inti = 0; I ) { for(intj = 0; J ) {System.out.print (" "); } for(intK = 1; K ) {System.out.print ("*"); } System.out.println (); } for(inti = 1; I ) { for(intj = 1; J ) {System.out.print (" "); } for(intj = 0; J ) {System.out.print ("*");

Java Common algorithm questions (24)

PackageCom.xiaowu.demo;//a 5-digit number, judging whether it is a palindrome number. That is, 12321 is a palindrome number, single-digit and million-bit the same, 10 bits and thousands of the same. Public classDemo24 { Public Static voidMain (string[] args) {F2 (123454321); } //Method One Public Static voidF1 (intN) {if(n >= 10000 N ) {String s=string.valueof (n); Char[] C =S.tochararray (); if(C[0] = = C[4] c[1] = = C[3]) {System.out.println (n+ "is a palindrome number. "); } Else{Sy

Java Common Algorithm questions (16)

PackageCom.xiaowu.demo;//Monkey Eat Peach problem: The first day of monkeys to take off a number of peaches, immediately ate half, still not enjoyable, and eat one more;//The next morning he ate half of the remaining peaches and ate one more. //every morning after eating the rest of the day half of the zero one. By the 10th morning when I wanted to eat again, there was only one peach left. Ask how many peaches were picked on the first day. Public classDemo16 { Public Static voidMain (string[] a

Java Common Algorithm questions (19)

PackageCom.xiaowu.demo;/*** * There is a fractional sequence: 2/1,3/2,5/3,8/5,13/8,21/13 ... find the sum of the first 20 items of this series. * * * @authorWQ **/ Public classDemo19 { Public Static voidMain (string[] args) {sum (20); } Public Static voidSumintN) {Doublex = 2.0; Doubley = 1.0; DoubleT; Doublesum = 0; for(inti = 1; I ) {sum+ = (X/y); T=y; Y=x; X= y +T; } System.out.println (The "before" + N + "items are the same as:" +sum); }}Java

Java Common algorithm questions (eight)

PackageCom.xiaowu.demo;/*** Find the value of S=A+AA+AAA+AAAA+AA...A, where a is a number. For example 2+22+222+2222+22222 (there are 5 numbers added at this time), * Several numbers are added by keyboard control. * * @authorWQ **/ Public classDemo8 { Public Static voidMain (string[] args) {sum (2, 5); } Public Static voidSumintAintN) {intb =A; Longsum = 0; for(inti = 0; I ) {sum+=A; A= A * 10 +b; } System.out.println ("And as:" +sum); }}Java

Java Common algorithm questions (vii)

PackageCom.xiaowu.demo;/*** Enter a line of characters to count the number of letters, spaces, numbers, and other characters in each of them. * * @authorWQ **/ Public classDemo7 { Public Static voidMain (string[] args) {String s= "Hello world! Beijing Aoyun 2008. "; Number (s); } Public Static voidNumber (String s) {intDigital = 0; intCharacter = 0; intother = 0; intBlank = 0; Char[] ch =S.tochararray (); for(inti = 0; i ) { if(Ch[i] >= ' 0 ' ch[i] ) {Digital++; } Else if((C

The difference between the forward and redirect of Common face questions in Java

HttpServletRequest class.For the indirect way, the server side in response to the first request, the browser to another URL to make a request, so as to achieve the purpose of forwarding. It is essentially two HTTP requests, corresponding to two request objects.For the direct way, the client browser only makes one request, and the servlet forwards the request to the servlet, HTML, JSP, or other information resource, and the 2nd information resource should respond to the request, and two informat

Java threading common face questions include adding minus 1 to multiple threads without using an inner class

Class ManyThreads2 {private int j = 0;Public synchronized Void Inc () {j + +;System.out.println (Thread.CurrentThread (). GetName () + "Inc" + j); }public synchronized void Dec () {j--;System.out.println (Thread.CurrentThread (). GetName () + "Dec" + j);}}public class MyTest extends Thread {Private MANYTHREADS2 many = new ManyThreads2 ();public void Run (){many.inc ();Many.dec ();Many.inc ();Many.dec ();}public static void Main (string[] args) {TODO auto-generated Method StubMyTest MyTest = new

Some Questions about "Parameters" may be asked during the interview ~, Questions and interviews

: emphasize some experience you have learned during your previous part-time or practical activities, especially when you are willing to learn and have strong learning abilities. Question 10: "What are your requirements for salary ?"Suggestion: before the interview, you should first have an understanding of the current industry, the position and the average salary level of the company. Unless you think you are good or have a high requirement on the bot

7 JavaScript interview questions for true and false javascript questions

7 JavaScript interview questions for true and false javascript questions The following seven JavaScript interview questions should be asked before the interview. Otherwise, your time may be wasted.1. What are the two methods for c

Classic 20 Ajax interview questions, no longer afraid of interview after reading

This article mainly tells about the Ajax 20 interview questions, will have these questions, the interview is not afraid of, according to the above answer, certainly can find a good job. Now let's see this article together. 1, what is Ajax, why use Ajax (please talk about your understanding of Ajax)What is Ajax:Ajax is

25 JavaScript interview questions that you need to know, javascript questions

25 JavaScript interview questions that you need to know, javascript questions 1. Use typeof bar === "object" to determine if bar is an object with potential drawbacks? How can we avoid such disadvantages? The disadvantage of using typeof is obvious (this disadvantage is the same as using instanceof ): let obj = {};let arr = [];console.log(typeof obj === 'object')

[Android interview] highlights of Android interview questions (updated in succession)

I will summarize some common android interview basic questions to see how many questions can you make? 1. What are several intent startup methods? Do you understand each meaning? Here, android123 reminds you that some intent tags include flag_activity_brought_to_front, flag_activity_clear_top, struct, struct, fl

Android interview questions, android interview

Android interview questions, android interview1. How to Improve the sliding efficiency of ListView2. Let's talk about the architecture of the project package (networking, parsing, activity, database ).3. how to load a large number of images (including small images and big charts), how to reduce the number of connections to the server at a time, and how to cache images,4. Relationship between onInterceptTouc

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.