en
Vibrant Publishers

CORE JAVA Interview Questions You'll Most Likely Be Asked

Beri tahu saya ketika buku ditambahkan
Untuk membaca buku ini unggah file EPUB atau FB2 ke Bookmate. Bagaimana cara mengunggah buku?
  • Elvin Mahmudovmembuat kutipan5 tahun yang lalu
    8: How will you define Synchronization?

    Answer:

    Synchronization is a locking mechanism which is used to control the threads. For example, if multiple threads try to access a shared resource at the same time, then we need some way for the resource to be accessed by only one Thread at a time. So, the main purpose of Synchronization is to protect and secure data.
  • Elvin Mahmudovmembuat kutipan5 tahun yang lalu
    e can create threads in two ways as described below:

    a) By extending “Thread” class

    b) By implementing the interface called “Runnable”
  • Elvin Mahmudovmembuat kutipan5 tahun yang lalu
    hat is the difference between wait() and sleep()?

    Answer:

    The sleep(n) asks the thread to wait for a specific amount of time. The thread wakes up exactly after the specified amount of time. The wait(x) method keeps the thread waiting for maximum specified amount of time. It may be invoked by a notify() or notifyAll() method anytime before the specified time.
  • Elvin Mahmudovmembuat kutipan5 tahun yang lalu
    There are three types of exceptions we need to take care of. They are:

    a) Runtime Exception or Unchecked Exception: These type of exceptions occur during run time as we don’t write code to handle exceptions

    b) Checked Exception: These types of exceptions are handled using try, catch, finally, throw or throws keyword.

    c) Error: It is the behavior which stops the working of the system during program execution.
  • Elvin Mahmudovmembuat kutipan5 tahun yang lalu
    Garbage collection is an automatic feature which takes care of memory management in Java.

    Whenever the objects are declared null or if the objects are no longer used in a program, the Java Virtual machine clears those objects from memory and thereby make the system clean.
  • Elvin Mahmudovmembuat kutipan5 tahun yang lalu
    We need to understand three features while invoking overloaded methods. They are

    a) Widening: This feature always chooses the maximum range of bytes. For example, Long type holds maximum amount of bytes than Integer.

    b) Autoboxing: This feature converts the primitive to wrapper and vice versa.

    c) Var-args: Using this feature, we can pass multiple arguments to a method by passing single argument with three dots as shown below:

    public static String invokeFormat(String strPattern,Object... myArgs);

    As per the above order, Widening overcomes Autoboxing and Var-Args and Autoboxing overcomes Var-args.
  • Elvin Mahmudovmembuat kutipan5 tahun yang lalu
    Garbage Collection is done in the Heap Memory.
  • Elvin Mahmudovmembuat kutipan5 tahun yang lalu
    “default” it gets executed and executes the next statement as well.
fb2epub
Seret dan letakkan file Anda (maksimal 5 sekaligus)