Interview Questions

Q:

What is wrapping?

Answer

Wrapping is also called as packing or boxing.


Storing the data inside the object as private data which can accessed outside the class only by using methods.


 

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 1859
Q:

What is unwrapping?

Answer

Unwrapping is also called as unpacking or unboxing.


Getting the private data stored in the object by using methods is called unpacking or unwrapping.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 1795
Q:

What is JAR file? what are the main uses of JAR files?

Answer

JAR files are java's version of ZIP files. In fact, JAR uses the ZIP file format.


uses:


- to compress a number of . class files into one file


- to make a java executable JAR file.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 1447
Q:

What is the difference between path and classpath?

Answer

Path contains path of .exe files(commands).


Classpath contains path of packages. packages can be stored in folder or .jar files

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 1705
Q:

What is the use of super call?

Answer

By using super call we can call super class constructors  from sub class constructors and we can initialize super class private data.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 1677
Q:

What is the use of overriding?

Answer

- By using method overriding a sub class can change the definition of super class method.


- By using overriding a sub class can modify the functionality of the super class.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 1687
Q:

What is the use of overloading ? or why overloading?

Answer

By using overloading we can add new functionality to the sub class.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 1562
Q:

What is final method?

Answer

Final method is a method defined in the super class with final modifier.


We cannot overriding final method of super class in the sub class.


EX:


 Class Sample {


   final void funOne() {


   }


   void funTwo() {


   }


}


Class Sub extends Sample {


  void funOne() { // overriding is not allowed


  }


  viod funTwo() { //overriding is allowed


  }


}

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 2070