August 27, 2019

Srikaanth

Marketo Frequently Asked Core Java Interview Questions

What Is Quick Sort?

For large arrays, you need an efficient sorting technique. One of the most efficient techniques is the quick sort. The quick sort technique takes the middle element of an array and sub-divides the array into two smaller arrays. One array will contain elements greater than the middle value of the original array. Conversely, the other array will contain elements that are less than the middle value. The quick sort will repeat this process for each new array until the final arrays contain only a single element. At this point, the single element arrays are in the proper order, as shown below

What Is The Difference Between Final, Finally And Finalize?

 final—declare constant
 finally—handles exception
 Finalize—helps in garbage collection.

In System.out.println( ), What Is System, Out And Println?

System is a predefined final class, out is a PrintStream object and println is a built-in overloaded method in the out object.

What Is Meant By "abstract Interface"?

First, an interface is abstract. That means you cannot have any implementation in an interface. All the methods declared in an interface are abstract methods or signatures of the methods.
Marketo Most Frequently Asked Core Java Interview Questions Answers
Marketo Most Frequently Asked Core Java Interview Questions Answers

What Is The Difference Between Swing And Awt Components?

AWT components are heavy-weight, whereas Swing components are lightweight. Heavy weight components depend on the local windowing toolkit. For example, java.awt. Button is a heavy weight component, when it is running on the Java platform for Unix platform, it maps to a real Motif button.

Why Java Does Not Support Pointers?

Because pointers are unsafe. Java uses reference types to hide pointers and programmers feel easier to deal with reference types without pointers.

What Are Parsers? Dom Vs Sax Parser.

Parsers are fundamental xml components, a bridge between XML documents and applications that process that XML. The parser is responsible for handling xml syntax, checking the contents of the document against constraints established in a DTD or Schema.

What Is A Platform?

A platform is the hardware or software environment in which a program runs. Most platforms can be described as a combination of the operating system and hardware, like Windows 2000/XP, Linux, Solaris and MacOS.

What Is The Main Difference Between Java Platform And Other Platforms?

The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other hardware-based platforms, The Java platform has two components

The Java Virtual Machine (Java VM).
The Java Application Programming Interface (Java API).

What Is The Java Virtual Machine?

The Java Virtual Machine is software that can be ported onto various hardware-based platforms.

What Is The Java Api?

The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets.

What Is The Package?

The package is a Java namespace or part of Java libraries. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as packages.

What Is Native Code?

The native code is a code that after you compile it, the compiled code runs on a specific hardware platform.

Is Java Code Slower Than Native Code?

Not really. As a platform-independent environment, the Java platform can be a bit slower than native code. However, smart compilers, well-tuned interpreters, and just-in-time bytecode compilers can bring performance close to that of native code without threatening portability.

What Is The Serialization?

The serialization is a kind of mechanism that makes a class or a bean persistence by having its properties or fields and state information saved and restored to and from storage.

How To Make A Class Or A Bean Serializable?

By implementing either the java.io.Serializable interface or the java.io.Externalizable interface. As long as one class in a class's inheritance hierarchy implements Serializable or Externalizable, that class is serializable.

How Many Methods Are There In The Serializable Interface?

There is no method in the Serializable interface. The Serializable interface acts as a marker, telling the object serialization tools that your class is serializable.

How Many Methods Are There In The Externalizable Interface?

There are two methods in the Externalizable interface. You have to implement these two methods in order to make your class externalizable. These two methods are

readExternal() and
writeExternal().

Which Containers Use A Border Layout As Their Default Layout?

The Window, Frame and Dialog classes use a border layout as their default layout.

What Is Synchronization And Why Is It Important?

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 causes dirty data and leads to significant errors.

What Are Three Ways In Which A Thread Can Enter The Waiting State?

A thread can enter the waiting state by invoking its sleep() method, by blocking on I/O, by unsuccessfully attempting to acquire an object's lock or by invoking an object's wait() method. It can also enter the waiting state by invoking its (deprecated) suspend() method.

What Is The Preferred Size Of A Component?

The preferred size of a component is the minimum component size that will allow the component to display normally.

Can Java Object Be Locked Down For Exclusive Use By A Given Thread?

Yes. You can lock an object by putting it in a "synchronized" block. The locked object is inaccessible to any thread other than the one that explicitly claimed it.

Can Each Java Object Keep Track Of All The Threads That Want To Exclusively Access It?

Yes.

What Is The Purpose Of The Wait(), Notify() And Notifyall() Methods?

The wait(), notify(), and notifyAll() methods are used to provide an efficient way for threads to wait for a shared resource. When a thread executes an object's wait() method, it enters the waiting state. It only enters the ready state after another thread invokes the object's notify() or notifyAll() methods.

What Are The High-level Thread States?

The high-level thread states are ready, running, waiting and dead.

What Is The Collections Api?

The Collections API is a set of classes and interfaces that support operations on collections of objects.

What Is The List Interface?

The List interface provides support for ordered collections of objects.

How Many Bits Are Used To Represent Unicode, Ascii, Utf-16 And Utf-8 Characters?

Unicode requires 16 bits.
ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits.
UTF-8 represents characters using 8, 16, and 18 bit patterns.
UTF-16 uses 16-bit and larger bit patterns.

Subscribe to get more Posts :