【正文】
public long CONSTANT_ONE = 1000。 } public abstract string anyAbstractFunction()。java英文面試筆試題 Question: What is transient variable? Answer: Transient variable cant be serialize. For example if a variable is declared as transient in a Serializable class and the class is written to an ObjectStream, the value of the variable cant be written to the stream instead when the class is retrieved from the ObjectStream the value of the variable bees null. Question: Name the containers which uses Border Layout as their default layout? Answer: Containers which uses Border Layout as their default are: window, Frame and Dialog classes. Question: What do you understand by Synchronization? Answer: Synchronization is a process of controlling the access of shared resources by the multiple threads in such a manner that only one thread can access one resource at a time. In non synchronized multithreaded application, it is possible for one thread to modify a shared object while another thread is in the process of using or updating the objects value. Synchronization prevents such type of data corruption. . Synchronizing a function: public synchronized void Method1 () { // Appropriate methodrelated code. } . Synchronizing a block of code inside a function: public myFunction (){ synchronized (this) { // Synchronized code here.