Synchronous
In multithreaded programs, synchronization modifiers are used to control access to critical section code. One way is to use the Synchronized keyword to ensure thread safety for your code. In Java, synchronized-modified code blocks or methods are not accessed concurrently by multiple threads. It forces the thread to obtain a lock before entering a method, releasing the lock when it leaves
COSCO Java interview question zzz
COSCO Java interview questions
Java training materialsI. Java language1. Three basic features of object-oriented2. Concepts and differences between method overloading and method Rewriting3. Featur
Framework BasicsReflection: Reflection is a kind of dynamic correlation mechanism of Java development. Because the Java language itself is not a dynamic language, if we want to get the dynamic effect of the program, we introduce the concept of reflection mechanism.How do you express reflection?What can I do with reflection?PS: An interview question: What are the
(keySpec) to get, remember type conversion
Encryption and decryption of keysThe process is consistent for both the public and private keys, regardless of the type of key, whether it is encrypted or decrypted. And cipher is the core class to accomplish this task.Basic process:
First by Cipher.getInstance("RSA") getting a cipher.
Initialization: cipher.init(Cipher.ENCRYPT_MODE, privatekey); only two parameters, first set mode, encrypt
What is a 1.Java set frame? What are some of the advantages of a collection framework?There are collections in each programming language, and the original Java version contains several collection classes: Vector, Stack, Hashtable, and array. With the extensive use of the collection, Java1.2 proposes a collection framework that encompasses all the set interfaces, implementations, and algorithms.
What is a 1.Java set frame? What are some of the advantages of a collection framework?There are collections in each programming language, and the original Java version contains several collection classes: Vector, Stack, Hashtable, and array. With the extensive use of the collection, Java1.2 proposes a collection framework that encompasses all the set interfaces, implementations, and algorithms.
blocked place.One thread calls the await method, and the other program does not call the Signalall method, then it is a deadlock and is blocked forever.The signal method can randomly dismiss a thread's blocking state. But if there is another block, and no other thread calls singnal again, the thread will deadlock.Synchronized keywordsKey to locks and conditions:
Locks are used to protect code fragments, and only one thread can execute the protected code at any time.
A lock can mana
Java.lang.reflect package:Class: Represents a Class.Field class: Represents a member variable of a class (a member variable is also called a property of a class).Method class: Methods that represent classes.Constructor class: Represents the construction method of a class.Array class: Provides a static method for dynamically creating an array, and for accessing the elements of an array.Here are a few examples to look at the practical use of the Reflection API:Get member variables, member methods
constants without a method, and any class that implements the interface automatically inherits these constants and can be consumed directly without the class name like a static domain. The form of a domain name Public Interface moveable{ void Move (doubledouble y);} Public Interface extends moveable{ double Milespergallon (); Double // Public static Final}L Although each class can only have one superclass, it can implement multiple interfaces. Use commas to separate the implementation
! = STR2STR1 = = str2So what's the output of the second program? The first way we talked about this is not to take the initiative to add the object to the string pool, but with an exception, calling the Intern () method manually will force a reference to the object to be added to the string pool. So the result of the second procedure isSTR1 = = str2"Question 4"differences and linkages between String pool and const poolKnowing the Java memory model, th
[Java Study Notes] Chapter 5 inheritance of Java core technologiesChapter 2 Inheritance
Using inheritance, You can construct a new class based on an existing class. Inheriting existing classes is to reuse (inherit) the methods and domains of these classes. You can also add new methods and domains.
Reflection.5.1 superclass subclass
Use extends to construct a deri
that the locks provided by Java are object-level rather than thread-level, and each object has a lock, which is obtained through the thread. The wait () method in the calling object is meaningful if the thread waits for some locks. If the wait () method is defined in the thread class, it is not obvious which lock the thread is waiting for. Simply put, because Wait,notify and Notifyall are both lock-level operations, they are defined in the object cla
. Otherwise, assertionerror is thrown. In addition, assert
Eighth, what is GC? Why does GC exist?GC is the meaning of garbage collection (gabage collection). Memory Processing is a place where programmers are prone to problems. Forgetting or wrong memory collection can lead to instability or even crash of programs or systems, the GC function provided by Java can automatically monitor whether the object exc
Java advanced interview including architectsTags: schema 2016-11-25 16:04 3090 people read comments (0) Collection report
Directory (?) [+] JDK1.5 new features ==>>> character streams and byte stream differences, use scenarios, related classes ==>>> thread safety concepts, Several ways to implement thread safety ==>>> the difference between abstract classes and interfaces, the implementation principle of
The Java Collection framework is the foundation of the Java programming language and is an important knowledge point in the Java interview. Here, I've listed some important questions and answers about the Java collection.What is a 1.Java
I. Basic knowledgeJava Collection FrameworkWhat is a 1.Java set frame? What are some of the advantages of a collection framework?There are collections in each programming language, and the original Java version contains several collection classes: Vector, Stack, Hashtable, and array.With the extensive use of the collection, Java1.2 proposes a collection framework that encompasses all the set interfaces, imp
is 443.
The HTTP connection is simple and stateless; The HTTPS protocol is a network protocol built by the SSL+HTTP protocol for encrypted transmission and authentication, which is more secure than the HTTP protocol.
HTTP uses port 80 by default, HTTPS uses 443 port by default
How HTTPS ensures the security of data transmissionHTTPS is actually in the TCP layer and the HTTP layer between the SSL/TLS to secure the upper layer, the main use of symmetric encryption, asymmetric encrypt
thread difference, one is the class is an interface, and (did not know) Runnable can facilitate the sharing of resources, thread does not, thread implementation of the Runnable interface
Related Materials Reference http://developer.51cto.com/art/201203/321042.htm
The difference between run () and Statr () I think there is a more detailed and professional answer http://www.cnblogs.com/linjiqin/archive/2011/04/10/2011272.html
Asked the design pattern of a single case pattern and decorator pattern
2.1.1 A brief talk on the cross-platform principle of JavaBecause the instruction set supported by each operating system (Windows,linux) is not exactly the same, it will allow our program to execute different program code on different operating systems, Java has developed a Java virtual machine for different operating systems and bits to shield the differences between the systems, providing a unified interf
questions. If any interview asks this question, I suggest you stay away from the company.
14th, does the array have the length () method? Does string have the length () method?
The array does not have the length () method. It has the Length attribute.String has the length () method.
15th, the difference between overload and override. Can the overloaded method change the type of the returned value?
Overriding and overloading are different manifestati
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.