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
method in a subclass that has the same name and parameters as its parent, we say that the method is overridden (override). When an object of a subclass uses this method, the definition in the subclass is called, and for it the definition in the parent class is "masked".
If more than one method with the same name is defined in a class, they either have a different number of arguments or have different parameter types, which is called a method overload (overload).The overloaded method is a ty
original address.Redirect is the server based on logic, send a status code, tell the browser to request the address again, in general, the browser will use all the parameters just requested again, so the session,request parameters can be obtained.3 The difference between a dynamic include and a static include in a JSPA collection of questions and answers about Java
solves this problem for us. After the online pool submits the callable task, a future object is returned, using which we can know the status of the callable task and get the result of the execution callable returned. The future provides a get () method so that we can wait for callable to end and get its execution results.What is Futuretask?Futuretask is a fundamental implementation of the future, and we can use it with executors to handle asynchronous tasks. Usually we do not need to use the Fu
return statement in try {}, so will the code in finally {} following this try be executed? When will it be executed, before or after return?
Will be executed, before return.
28th. Programming question: how many equals 2x8 in the most efficient way?
Programmers with a C background are particularly fond of asking such questions.
29th, the two objects have the same value (X. Equals (y) = true), but diffe
-threaded access to shared resources, due to improper access, usually a thread locked a resource A, but also want to lock resource B, and in another thread, the lock resource B, but also to lock resource A to complete its own operations, two threads want the other's resources, Instead of releasing their own resources, two of threads are waiting for a situation that cannot be performed.Java Network Programming approximate process:UDP programmingSend si
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
we don't want to repeat, we should use set.
(2) Some collection classes allow the initial capacity to be specified, so if we can estimate the number of storage elements, we could use it to avoid a hash or resize.
(3) Based on interface programming, rather than on implementation programming, it allows us to easily change implementations later.
(4) Always use type-safe generics to avoid classcastexception
The first one discusses object-oriented programming and its features, common questions about Java and its functionality, Java collection classes, garbage collectors, this chapter focuses on exception handling, Java applets, SWING,JDBC, remote method Invocation (RMI), servlet
Java Multithreaded interview questions
1. What is the difference between processes and threads?
A process is a stand-alone (self contained) operating environment that can be viewed as a program or an application. A thread is a task that is performed in a process. The Java Runtime environment is a single process that contains different classes and programs. Thre
?
What is Futuretask?
How to wake up a blocked thread?
How do immutable objects help with multithreading?
What does multi-threaded context switching mean?
What thread scheduling algorithms are used in Java?
What is the role of Thread.Sleep (0)?
What is the Java memory model, which areas are thread-shared, and which are unshared
What are optimistic and pessimistic locks?
Why do I synchroniz
JAVA back-end test questions (1), java back-end test questions
The weather turns cloudy on January 1, June 7, 2017. Good mood.
I took my first test last Saturday. I felt very bad. I did
Jame Dean 2016-12-06 17:12
Basic Knowledge section (90 points)
one, the single choice question (altogether 12 questions, each question 3 points, altogether 36 points. )
1, Java is from (B) language improvement redesign.
A) Ada
B) C + +
C) pasacal
D) BASIC
2. Which of the following statements is correct (B)
A Java program generates machine code after compiling
B
. TreeSetthe largest and smallest elements can be obtained from.
Summary: Collections.sort() provides a list that is sorted once. PriorityQueueand TreeSet Dynamic maintenance of the ordered collection.9. Copy ListThere are two ways to copy a list. One is to use a ArrayList constructor.
1
ArrayListnewArrayList
The other is to use Collections.copy() .
12
ArrayListnewArrayListCollections.copy(dstList, srcList);
It is important to
++;Parent.printvalue (); ((child) parent). myvalue++;Parent.printvalue ();}}Operation Result:Summarize:When a subclass has the same method as the parent class, and a parent class variable refers to a subclass object, which method is called, determined by the object's own "true" type, that is, the object is a subtype, it calls the method of the subtype, it is the parent type, and it invokes the method of the parent type. This feature is actually a concrete representation of the object-oriented "
inheritance of the thread class and implementation of the Runnable interfaceThere are two kinds of implementations of synchronization, namely Synchronized,wait and notify
What is the difference between dynamic include and static include in 11.JSP?
Dynamic include using Jsp:include action to implement
It always checks for changes in the contained files, suitable for inclusion of dynamic pages, and can be used with parameter
Static include with the include pseudo code implementation, will not
thread in the ready state by dispatching it to occupy the CPU and turn it into a running state. At this point, the system actually executes the thread's run () method.④ Blocking and waking threadsBlocking state (Blocked): A running thread enters a blocking state when it cannot continue running for some reason. These reasons include:(a) When a method of blocking type such as sleep () of a thread object is executed, the thread object is placed in a block set and waits for a timeout to automatical
single-threaded program can not produce OutOfMemoryError exception, using multithreading will also appear outofmemeoryerror, because the stack is thread-private, line multithreading also overflow method area3, JVM stack space allocation over the General Assembly caused by what problemshttp://blog.csdn.net/qq_30739519/article/details/510425844. How to detect dead loops and deadlocks in the JVMDeadlock: http://www.cnblogs.com/ilahsa/archive/2013/06/03/3115410.htmlDead Loop: http://blog.csdn.net/s
also has a J-letter, such as: Jmouseadapter
6. Public class Eqtest {public static void main (String args[]) {eqtest e=new eqtest ();} Eqtest () {String s= "Java"; String s2= "Java"; Place the test code {System.out.println ("equal");} else {System.out.println ("unequal");} In the comment line position of the Java code
digits to accurately represent (even need infinity), and the double type of the value of only 64bit, the back of the number of bits will definitely bring error, can not get "mathematically accurate" results.2. Questions about the number of bits and ranges represented by each data type in JavaA : The conversion of data types in Java, from high-precision like low-precision conversion will have a loss of p
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.