Java Interview Questions & Answers - Learning Mode

Java is a programming language and computing platform first released by Sun Microsystems in 1995. There are lots of applications and websites that will not work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable.
Java is a programming language expressly designed for use in the distributed environment of the Internet. It was designed to have the "look and feel" of the C++ language, but it is simpler to use than C++ and enforces an object-oriented programming model.

Answer:
You would create interfaces when you have two or more functionalities talking to each other. Doing it this way help you in creating a protocol between the parties involved.
Source: CoolInterview.com

Answer:
Java is not a fully object oriented language because it does not support multiple inheritance directly.But it does so by using theconcept of interfaces.

A language is said to be fully object oriented if it supports classes,objects,inheritance and polymorphism.For example C++ supports full fledged feature of inheritance and all the types of inheritances(single,multilevel,multiple,hierarchical and multipath inheritances), and if we take the polymorphism C++ supports static binding and oper
Source: CoolInterview.com

Answer:
A package is a grouping of related types providing access protection and name space management. Note that types refers to classes, interfaces, enumerations, and annotation types. Enumerations and annotation types are special kinds of classes and interfaces, respectively, so types are often referred to in this lesson simply as classes and interfaces.
Source: CoolInterview.com

Answer:
Java is multi platform-> Platform Independent Language, so its used widely in very big softwares or games where multiple variables needed. To Differentiate among that huge no of variables,,Java is Case Sensitive.
Source: CoolInterview.com

Answer:
JVM is an abstract computing machine like any other real computing machine which interprets the byte code( .class file which contains virtual machine instructions ) to a machine dependent native code. The output of JVM i.e the native code contains low level instructions which is easily understandable by the micro processors which process the native code to give the desire output.
Source: CoolInterview.com

Answer:
You should use the word synchronized to mark the critical section of code. You may also use other methods of thread synchronization (see wait(), notify(), notifyAll() etc.
Source: CoolInterview.com

Answer:
Type 1: JDBC-ODBC Bridge plus ODBC Driver: The first type of JDBC driver is the JDBC-ODBC Bridge. It is a driver that provides JDBC access to databases throughODBC drivers. The ODBC driver must be configured on the client for the bridge to work. This driver type is commonly used for prototyping or when there is no JDBC driveravailable for a particular DBMS.

Answer:
instanceof is used to check to see if an object can be cast into a specified type without throwing a cast class exception. isInstance() determines if the specified object isassignment-compatible with the object represented by this Class. This method is the dynamic equivalent of the Java language instanceof operator. The method returns trueif the specified Object argument is nonnull and can be cast to the reference type represented by this Class object without raising a ClassCastException
Source: CoolInterview.com

Answer:
With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for onethread 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.
Source: CoolInterview.com

Answer:
You cannot inherit a constructor. That is, you cannot create a instance of a subclass using a constructor of one of it's superclasses. One of the main reasons is because youprobably don't want to overide the superclasses constructor, which would be possible if they were inherited. By giving the developer the ability to override a superclassesconstructor you would erode the encapsulation abilities of the language.
Source: CoolInterview.com