Cracking the Java Coding Interview pdfdrive com


With respect to multithreading, synchronization is the capability to control


Download 1.48 Mb.
Pdf ko'rish
bet82/182
Sana02.05.2023
Hajmi1.48 Mb.
#1423275
1   ...   78   79   80   81   82   83   84   85   ...   182
Bog'liq
Cracking the Java Coding Interview ( PDFDrive )

With respect to multithreading, synchronization is the capability to control
the access of multiple threads to shared resources. Without synchronization,
it is possible for one thread to modify a shared object while another thread
is in the process of using or updating that object’s value. This often leads to
significant errors.
How are Observer and Observable used?
Objects that subclass the Observable class maintain a list of observers.
When an Observable object is updated it invokes the update() method of
each of its observers to notify the observers that it has changed state. The
Observer interface is implemented by objects that observe Observable
objects.
what is a transient variable? A transient variable is a variable that may not
be serialized.


Interview Part 2
Question Can there be an abstract class with no abstract methods in it?
(Core Java)
Answer: Yes
Question Can an Interface be final? (Core Java)
Answer: No
Question Can an Interface have an inner class? (Core Java)
Answer: Yes.
public interface abc {
static int i=0;
void dd();
class a1 {
a1() {
int j;
System.out.println("in interfia");
};
public static void main(String a1[]) {
System.out.println("in interfia"); } } }
Question Can we define private and protected modifiers for variables in interfaces? (Core Java)
Answer No.
Question What is the query used to display all tables names in SQL Server (Query analyzer)? (JDBC)
Answer select * from information_schema.tables
Question What is Externalizable? (Core Java)
Answer Externalizable is an Interface that extends Serializable Interface. And
sends data into Streams in Compressed Format. It has two methods,
writeExternal(ObjectOuput out) and readExternal(ObjectInput in)

Download 1.48 Mb.

Do'stlaringiz bilan baham:
1   ...   78   79   80   81   82   83   84   85   ...   182




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling