3i Infotech Papers: Sample Questions 883 - 884 of 1245

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 883

» Languages » Java

Essay Question▾

Describe in Detail

What are the advantages of java over c++?

Explanation

  • Easy to learn:

    • Java is easier to learn.

    • Take less time to learn the core concepts and syntax.

  • No pointers:

    • Using pointers without proper knowledge is a tragedy.
  • platform independent:

    • Compiles java code can run on all platforms that support java without the need for recompilation.
  • Garbage collection:

    • JVM garbage collector does automatic memory management.

    • Prevents memory leak in java application.

  • Just in time compiler:

    • Java uses JIT compiler to execute java byte code- faster.

    • JIT compiler is independent of JVM.

  • Concurrent:

    • Multi-threaded applications are easy to create in java- inherently threaded.
  • Reflective:

    • Java provides the ability to examine, introspect, and modify its own structure and behaviour at runtime.
  • Exception handling:

    • C++ supports exception handling but Java has extra features like finally block and throws.
  • Easy to display:

    • Creating packages in java provides ease of deployment.

    • Java has its own archive formats like. jar for application deployment.

  • Web application:

    • Java is one of the important languages for web application.

    • J2EE can create robust enterprise level web applications.

Question number: 884

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

How is exception handling carried out in C++?

Explanation

Understanding of throwable parts.

Understanding of Throwable Parts.

Understanding of throwable parts.

  • Exception handling is done using catch block and throw statement.

  • Try includes code, which result in exception.

  • One or more catch enclose the try “catch” the exception starting from most specific to least specific.

  • Function can declare a throw (…. ) declaration stating that it does not handle exceptions of the specified types.

  • Such exceptions are then thrown to the calling function.

  • If an exception remains unhandled program will have abnormal termination.

  • Try catch blocks can be nested any level.