Overblog
Edit post Follow this blog Administration + Create my blog
Core Java

The Core Java Interview

Basic Java Training Tips

Basic Java Training Tips

A Java Interview Question can confuse programmers and can lead to bad decision making. When you start your Java Interview, you may find yourself pondering a lot of questions that you might not have considered before. Here are some of the most frequently asked Java Interview Questions and their answers.

 

Static vs. Dynamic - Java is object-oriented and dynamic means it can be run outside a container or virtual machine. Static methods are static and are executed inside the Java code. How do they differ from each other? Why the use of super-keywords in Java? Why static final variable is not allowed in Java? These are the many Core Java Interview Questions you need to answer for your application to pass the interview.

 

Overloaded or Overridden static methods - One of the most frequently asked interview questions is whether you can overload or override a static method. Overloading basically means to override a static method in Java code. On the other hand, overrenouncing means to directly create an instance of a static object without invoking the super keyword. The use of both of these keywords is considered a risky combination in the eyes of the Java coding standards team.

 

Instance creation vs. instantiation - Another Java Interview question is whether you can create and instantiate objects at the same time. Basically, instantiation means creating a new instance of an object while instantiating means creating an instance of a derived class. As explained above, Java allows you to instantiate and create a derived class at the same time. However, one important aspect of Java which is less explored is whether a derived class can be instantiated as well. Learn more about programming at http://www.dictionary.com/browse/code.

 

Overloads on constructors - Java has two different constructors: static and final. A static Constructor is used to create a static object. A final Constructor is used to create a final static object. As the question implies, a static Constructor is used to avoid repetition, while a final Constructor ensures that the last result is a final static.

 

Default arguments - One more Core Java Interview Questions is whether you can pass default arguments to a constructor. In short, the answer is 'yes.' Java uses a singleton, which means a single instance of any object is created, rather than each class being an instance of a singleton. Therefore, each time you create an object, you create a default object, which is the default value of the instance being created. So, every time a static or final Constructor is called, you are actually creating a new instance of that static or final method.

Share this post
Repost0
To be informed of the latest articles, subscribe:
Comment on this post