November 6, 2018

Srikaanth

Concentrix Most Frequently Asked Core Java Interview Questions Answers

What Is Java Jit Compilers?

When your Java-enabled browser connects to a server and tries to view a Web page that contains a Java applet, the server transmits the bytecode for that applet to your computer. Before your browser can run the applet, it must interpret the bytecode data. The Java interpreter performs the task of interpreting the bytecode data.
As you have learned, using an interpreter to read bytecode files makes it possible for the same bytecode to run on any computer (such as a Window-based or Mac-based computer) that supports Java. The big drawback is that interpreters can be 20 to 40 times slower than code that was custom or native, for a specific computer.
As it turns out, a new type of browser-side software, called a Just-In-Time compiler (JIT), can convert (compile) the bytecode file directly into native code optimized for the computer that is browsing it. The JIT compiler will take the bytecode data sent by the server and compile it just before the applet needs to run. The compiled code will execute as fast as any application you already use on your computer. As you might expect, the major compiler and IDE manufacturers, such as Borland, Microsoft, Symantec and Metroworks, are all developing JIT compilers.

What Is The Java Idl System?

The Interface Definition Language (IDL) is an industry standard format useful for letting a Java client transparently invoke existing IDL object that reside on a remote server. In addition, it allows a Java server to define objects that can be transparently invoked from IDL clients. The Java IDL system lets you define remote interfaces using the IDL interface definition language which you can then compile with the idlgen stub generator tool to generate Java interface definitions and Java client and server stubs.

What Is Java Beans?

Java Beans is the name of a project at JavaSoft to define a set of standard component software APIs (Application Programmers Interface) for the Java platform. By developing these standards, it becomes possible for software developers to develop reusable software components that end-users can then hook together using application-builder tools. In addition, these API's make it easier for developers to bridge to existing component models such as Microsoft's ActiveX, Apple's OpenDoc and Netscape's LiveConnect.

What Is Object-oriented Programming?

To programmers, an object is a collection of data and methods are a set of operations that manipulate the data. Object-oriented programming provides a way of looking at programs in terms of the objects (things) that make up a system. After you have identified your system's objects, you can determine the operations normally performed on the object. If you have a document object, for example, common operations might include printing, spell-checking, faxing or even discarding.

Object-oriented programming does not require a special programming language such as Java.You can write object-oriented programs in such languages as C++ or Java or C#. However, as you will learn, languages described as "object-oriented" normally provide class-based data structures that let your programs group the data and methods into one variable. Objects-oriented programming has many advantages, primarily object reuse and ease of understanding. As it turns out, you can often use the object that you write for one program in another program. Rather than building a collection of function libraries, object-oriented programmers build class libraries. Likewise, by grouping an object's data and methods, object-oriented programs are often more readily understood than their non-object- based counterparts.

What Is Abstraction?

Abstraction is the process of looking at an object in terms of its methods (the operations), while temporarily ignoring the underlying details of the object's implementation. Programmers use abstraction to simplify the design and implementation of complex programs. For example, if you are told to write a word processor, the task might at first seem insurmountable. However, using abstraction, you begin to realize that a word processor actually consists of objects such as a document object that users will create, save, spell-check and print. By viewing programs in abstract terms, you can better understand the required programming. In Java, the class is the primary tool for supporting abstraction.
Concentrix Most Frequently Asked Core Java Interview Questions Answers
Concentrix Most Frequently Asked Core Java Interview Questions Answers

What Is Encapsulation?

As you read articles and books about object-oriented programming and Java, you might encounter the term encapsulation. In the simplest sense, encapsulation is the combination of data and methods into a single data structure. Encapsulation groups together all the components of an object. In the "object-oriented" sense, encapsulation also defines how your programs can reference an object's data. Because you can divide a Java class into public and private sections; you can control the degree to which class users can modify or access the class data. For example, programs can only access an object's private data using public methods defined within the class. Encapsulating an object's data in this way protects the data from program misuses. In Java, the class is the fundamental tool for encapsulation.

How Does The Application Server Handle The Jms Connection?

App server creates the server session and stores them in a pool.
Connection consumer uses the server session to put messages in the session of the JMS.
Server session is the one that spawns the JMS session.
Applications written by the Application programmers creates the message listener.

What Is A Superclass?

When you derive one class from another in Java, you establish relationships between the various classes. The parent class (or the class it is being derived from) is often called the superclass or base class. The superclass is really an ordinary class which is being extended by another class. In other words, you do not need to do anything special to the class in order for it to become a superclass. Any of the classes you write may some day become a superclass if someone decides to create a new subclass derived from your class.

Of course, you can prevent a class from becoming a superclass (that is, do not allow it to be extended). If you use the final keyword at the start of the class declaration, the class cannot be extended.

Explain The Abstract Class Modifier?

As you have learned, Java lets you extend an existing class with a subclass. Over time, you may start to develop your own class libraries whose classes you anticipate other programmers will extend. For some classes, there may be times when it does not make sense to implement a method until you know how a programmer will extend the class. In such cases, you can define the method as abstract, which forces a programmer who is extending the class to implement the method.

When you use the abstract keyword within a class, a program cannot create an instance of that class. As briefly discussed, abstract classes usually have abstract methods which the class did not implement. Instead, a subclass extends the abstract class and the subclass must supply the abstract method's implementation. To declare a class abstract, simply include the abstract keyword within the class definition, as shown

public abstract class Some abstract Class
{
}

What Is The Final Class Modifier?

As you have learned, Java lets one class extend another. When you design a class, there may be times when you don't want another programmer to extend the class. In such cases, by including the final keyword within a class definition, you prevent the class from being subclassed. The following statement illustrates the use of the final keyword within a class definition

public final class TheBuckStopsHere
{
}

Explain The Public Class Modifier.

As you develop Java programs, there may be times when you create classes that you don't want the code outside of the class package (the class file) to access or even to have the knowledge of.
When you use the public keyword within a class declaration, you make that class visible (and accessible) everywhere. A non-public class, on the other hand, is visible only to the package within which it is defined. To control access to a class, do not include the public keyword within the class declaration. Java only lets you place one public class within a source-code file. For example, the following statement illustrates the use of the public keyword within a class

public class ImEverywhereYouWantMeToBe
{
}

What Is The Public Field Modifier?

A variable's scope defines the locations within a program where the variable is known. Within a class definition, you can control a class member variable's scope by preceding a variable's declaration with the public, private or protected keywords. A public variable is visible (accessible) everywhere in the program where the class itself is visible (accessible). To declare a variable public, simply use the public keyword at the start of the variable declaration, as shown
public int seeMeEveryWhere;

Explain The Private Field Modifier?

To control a class member variable's scope, you can precede the variable's declaration with the public, private or protected key words. A private variable is only visible within its class. Subclasses cannot access private variables. To declare a variable private, simply use the private keyword at the start of the variable declaration, as shown
private int InvisibleOutside;

Explain The Protected Field Modifier?

To control a class member variable's scope, you can precede the variable's declaration with the public, private ox protected keywords. A protected variable is one that is only visible within its class, within subclasses or within the package that the class is part of. The different between a private class member and a protected class member is that & private class member is not accessible within a subclass. To declare a variable protected, simply use the protected keyword at the start of the variable declaration, as shown

protected int ImProtected;

Can You Explain The Private Protected Field Modifier?

To control a class member variable's scope, you can precede the variable's declaration with the public, private or protected keywords. A private protected variable is only visible within its class and within subclasses of the class. The difference between a protected class member and a private protected variable is that a private protected variable is not accessible within its package. To declare a variable private protected, simply use the private protected keyword at the start of variable declaration, as shown

private protected int ImPrivateProtected;

What Is The Static Field Modifier?

Class member variables are often called instance variables because each instance of the class, each object, gets its own copy of each variables. Depending on your program's purpose, there may be times when the class objects need to share information. In such cases, you can specify one or more class variables as shared among the objects. To share a variable among class objects, you declare the variable as static, as shown

public static int ShareThisValue;

In this case, if object changes the value of the ShareThisValue variables, each object will see the updated value.

Subscribe to get more Posts :