java programming test questions and answers

Want to know java programming test questions and answers? we have a huge selection of java programming test questions and answers information on alibabacloud.com

Are you right about the common "factorial" programming questions in the written test?

In the written test, I think many people will encounter factorial programming questions. Today, I suddenly remembered my first written test. I encountered such a question, but I haven't typed it on my computer. I just want to write it. I don't know if everyone has done the right thing during the written

Analysis of Java 2 programmer test (SCJP) Questions

Analysis of the Java2 Programmer examination (SCJP) -- Linux general technology-Linux programming and kernel information. The following is a detailed description. Preface Whether you are a newbie or an expert in programming, you will be amazed by the Infinite Charm of Sun's Java. Java brings you more than just the adv

China MOOC_ object-oriented Programming--java language _ Final Exam programming questions _1 cellular automata

Final Exam Programming QuestionsreturnThis is a programming question for the final exam.Warm tips:1. This exam belongs to the online Judge topic and is enigmatic grading by the system immediately after submission.2. Students can submit their answers before the test deadline and the system will take the highest score as

Java BASIC Programming 50 questions (22-24 questions) detailed

word key that needs to be counted, then take advantage of Java's own indexof () Find the first occurrence of the word position,//statistics plus 1, and the previous statistics of the string truncated, in the remaining fields to match. int times = 0;while (true) {int index = Str.indexof (key), if (Index! =-1) {times++;str = str.substring (index + key.length ( ));} Else{return Times;}}}Operation Result:Source Code 3:Package Com.yue.day11;import Java.util.scanner;public class Yanghuitri {/** * Pri

2016 Ctrip test intern written programming questions

)//the set color is no longer scanned. { intmaxindex=0, minindex=99999; for(Auto J=collect.begin (); J!=collect.end (); j + +){ if((*J) .second>maxindex) Maxindex=(*j). Second; if((*J) .secondminindex) Minindex=(*j). Second; Mintemp=maxindex-minindex+1; } if(mintempminnum) Minnum=mintemp; } } returnMinnum;}intMain () {intarray1[]={0,1,2,6,7,4,1,1,1,1,2,6,7,2,2,0}; Vectorint> v1 (array1,array1+ -); cout6) Endl; ret

Depth. NET platform and C # programming internal test Pen questions

= (apple) Fru;D:fruits fru=new Apple ();Fru. Convert (Apple);Analytical:A is used to determine that D does not have the syntax of convert12: The following C # code will appear error when running (BC) A:arraylist a1=new ArrayList ();A1. ADD (100);A1. ADD (100);B:hashtable ht=new Hashtable ();Ht. Add ("Zhang San", new Object ());Ht. Add ("Zhang San", new Object ());C:listString name=list[0];D:dictionaryforeach (Onject p in Dict. Values) {}Analytical:B, the Hashtable key cannot appear duplicates.C,

Introduction to C programming--a comprehensive exercise (iv) on-machine test questions

("Please enter the specified string:");scanf ("%s", a);Fu_zhi (A, b, ch);printf ("%s\n", b);37return 0;39}After that;1#include 23//defines a function such as4int Fu_zhi (Char *str1, char *str2, Char ch)5 {6 int i = 0, j = 0;7 while (STR1[I]!=CH)8 i++;9 while (str1[i]!= ') {Ten str2[j]= str1[i+1];One by one i++;j + +;13}STR2[J] = ' + ';return 0;16}171819int Main ()20 {(+ char a[100];-Char b[100];-Char ch;24printf ("Please enter the specified character:");scanf ("%c", ch);printf ("Please enter th

Java BASIC Programming 50 questions (1-3 questions) detailed

); System.out.println ("Please enter the lower limit of the number:"); int low = Scanner.nextint (); System.out.println ("Please enter a number cap:"); int high = Scanner.nextint (); if (Low>high) {System.out.println ("you entered the wrong data, please re-enter!") "); System.out.println ("Please enter the lower limit of the number:"); low = Scanner.nextint (); System.out.println ("Please enter a number cap:"); high = Scanner.nextint ();} SYSTEM.OUT.PRINTLN (all primes between low+ "-" +high+ ")

Digital Video 2015 Campus recruitment Java Test questions

multiple interfaces is similar to implementing multiple inheritance, but an abstract class can only implement single inheritance 10, using recursive method to find 5. Answer: public class test{public static void Main (string[] args) { System.out.println (JC (5)); public static int-JC (int n) { if (n== 0 | | n== 1) return 1; if (n > 1) return N*JC (n-1); return 0; } } 11, writing multithreaded code has several methods of implem

Java BASIC Programming 50 questions (4-6 questions) detailed

java.util.scanner;/* * Title: Decomposition of a positive integer factorization. For example: Enter 90 and print out 90=2*3*3*5. Program Analysis: The decomposition of n factorization, should first find a minimum prime number k, and then the following steps to complete: (1) If the prime number is exactly equal to N, then the decomposition of the factorization process has ended, printing can be. (2) if nOperation Result:2. Procedure 2Package Tong.yue.hong;import java.util.scanner;/** * Title: Us

Java Face test questions:

several interfaces, a Java program can inherit only one class at a time, but several interfaces may be implemented, interfaces cannot have any specific methods, and interfaces can be used to define a set of constants that can be used by a class. Its implementation is interface to achieve. Copyright notice: I feel like I'm doing a good job. I hope you can move your mouse and keyboard for me to order a praise or give me a comment, under the Grateful!__

Java BASIC Programming 50 questions (7-9 questions) detailed

) {Integer a = Integer.parseint (num);Long sum = 0;Long subsum = 0;for (int i=1;iSubsum = Subsum*10+a;sum = sum+subsum;}return sum;}}Operation Result:3. Procedure 3Package Tong.yue.hong;Import Java.util.Scanner;/** Title: If a number is exactly equal to the sum of its factors, this number is called the "end number", that is, the non-repetition factor other than itself and equal to itself. Programming to find all the finished numbers within M.* For exa

Linux under C programming: Huawei C language Face test questions variable

Huawei C Language interview questions: The local variables of the program exist in (the stack), and the global variables exist in the (static area), and the dynamic request data exists in (the heap). A little summary: 1, on the stack, the most impressive is doing uboot transplant, when you are ready to enter the C code, you must give C code a good operating environment, one of the important thing is to set up the stack. 2, on the static memory all

Java BASIC Programming 50 questions (25-27 questions) detailed

, and the duplicate char is stored in ArrayList. We use the Collections.sort () function to sort the characters in the ArrayList, so the same characters must be contiguous. It then loops through the elements in the TreeSet collection, looking for the first and last occurrence of the element in ArrayList, the number of occurrences = The last occurrence-the number of occurrences of the first occurrence of +1.Second, the source codeProgram 1:Operation Result:Program 2:Operation Result:Program 3: O

Java BASIC Programming 50 questions (10-12 questions) detailed

hundreds, 10 digits, single digit numbers are 1, 2, 3, 4. But must satisfy each one on the number is different, according to the permutation combination principle altogether has the 4*3*2=24 species. * @author Tong * */public class Pailiezuhe {public static void main (string[] args) {int count = 0;for (int i = 1; I Operation Result:3. Procedure 3Package Tong.yue.hong;import java.util.scanner;/** * The bonus awarded by the Enterprise is based on the profit commission. * Profit (I) less than or e

Linux under C programming: Huawei C language Face test questions of the extern

Huawei C language Face test How do I refer to a global variable that has already been defined? Answer: extern You can use the reference header file in a way that you can also use the extern keyword, if you use a reference header file to refer to a global variation declared in a header file, assuming that you write the variable incorrectly, the error occurs during compilation, and if you use an extern reference, suppose you make the same mistake, Th

Analysis of Java 2 programmer test (SCJP) Questions

PrefaceWhether you are a newbie or an expert in programming, you will be amazed by the Infinite Charm of Sun's Java. Java brings you more than just the advantages of object-oriented, open, platform-independent, easy-to-use, secure, and "Write once, run anywhere" software development. More importantly, it provides a novel way of expressing ideas and a brand new wa

BAT and other large companies often test Java multi-threaded face questions

type variables? Volatile has two main functions: 1. Avoid command rearrangement 2. Visibility guarantees. For example, the JVM or JIT will reorder the statements for better performance, but the volatile type variable will not be reordered with other statements even if there are no synchronized blocks. Volatile provides happens-before guarantees that a thread's modifications can be visible to other threads. In some cases, volatile can also provide atomicity, such as reading 64-bit data type

Ali P8 Architect summarizes Java concurrency test questions (featured)

owns the lock gets the lock again, then the fetch counter increases by 1, and then the lock needs to be freed two times to get a true release. This mimics the semantics of synchronized; If a thread enters a synchronized block that is protected by a monitor that the thread already owns, it allows the thread to continue and does not release the lock when the thread exits the second (or subsequent) synchronized block. The lock is released only when the thread exits the first synchronized block tha

Cover all kinds of tedious Java test/interview questions

This article includes a variety of tedious Java written/interview questions, some of which are easy to forget and occasionally updated. I also hope that you can leave a message below to post all kinds of tedious test and interview questions you have encountered or seen.J2EE Basics 1. What is the result of the following

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