Java Questions

Q:

What is difference between Path and Classpath?

Answer

PATH and CLASSPATH are operating system level environment variables. PATH is used to define where the system can find the executables (.exe) files whereas CLASSPATH is used to specify the location of .class files.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

1 3241
Q:

What is the most important feature of Java?

Answer Java is a platform independent language.
Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 3216
Q:

What is autoboxing and unboxing ?

Answer

Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes. For example, converting an int to an Integer, a double to a Double, and so on. If the conversion goes the other way, this is called unboxing. 

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 3194
Q:

What is synchronization and why is it important ?

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 one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often leads to significant errors.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 3177
Q:

Which of the following is not used for commenting in java?

A) // B) /* */
C) /** */ D) /** **/
 
Answer & Explanation Answer: D) /** **/

Explanation:
  • //               is a single line comment
  • /*  */          is commenting on one or more lines
  • /** */         is documentation comment
Report Error

View Answer Report Error Discuss

Filed Under: Java

1 3177
Q:

Is the JDBC-ODBC Bridge multi-threaded ?

Answer

No. The JDBC-ODBC Bridge does not support multi threading. The JDBC-ODBC Bridge uses synchronized methods to serialize all of the calls that it makes to ODBC. Multi-threaded Java programs may use the Bridge, but they won't get the advantages of multi-threading.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 3109
Q:

What is Marker Interface?

Answer

An interface without having any methods and by implementing that interface if our objects will get same ability such type interfaces are called marker interface (or) ability interface (or) tag interface

Report Error

View answer Workspace Report Error Discuss

Subject: Java
Job Role: IT Trainer

1 3100
Q:

What is the impact of declaring a method as final?

Answer A method declared as final can't be overridden. A sub-class can't have the same method signature with a different implementation.
Report Error

View answer Workspace Report Error Discuss

Subject: Java

1 3072