Applets Technology Pvt Ltd Interview Questions

12 Can the main method be overloaded?

Yes, the main method can be overloaded as many times as we want. Nevertheless, JVM prefers to call the main method with the help of its predefined calling method.Â

Example:

    public static void main(String args[]) {

        System.out.println(” Main Method”);

    public static void main(int[] args){

        System.out.println(“Overloaded Integer array Main Method”);

    public static void main(char[] args){

        System.out.println(“Overloaded Character array Main Method”);

    public static int main(double[] args){

        System.out.println(“Overloaded Double array Main Method”);

    public static void main(float args){

        System.out.println(“Overloaded float Main Method”);

What is JDBC DatabaseMetaData interface?

The DatabaseMetaData interface returns the information of the database such as username, driver name, driver version, number of tables, number of views etc.

1 Define Copy Constructor in Java

A Copy Constructor in Java is a constructor that initializes an object through another object of the same class.

8 Explain Method Overloading in Java.

The process of creating multiple method signatures using one method name is called Method Overloading in Java. Two ways to achieve method overloading are:

  • Varying the number of arguments
  • Changing the return type of the MethodÂ
  • Core Java Interview Questions for Intermediates

    In this section, you will find some frequently asked Core Java interview questions for intermediate-level software developers and engineers.

  • What are the variants of JDK?
  • Explain Access Specifiers in Java.
  • What are the types of Access Specifiers?
  • Does a constructor return a value in Java?
  • What is the ‘this’ keyword in Java?
  • Why is the ‘super’ keyword used in Java?
  • What is Method Overloading?
  • Is it possible to overload a static method?
  • What is Late Binding in Java?
  • Explain Dynamic Method Dispatch in Java.
  • Why does the delete function work faster in the linked list than in an array?
  • What do you know about the life cycle of a thread?
  • Difference between >>> and >> operators.
  • What can you tell about the life cycle of an applet?
  • Why do we use generics in Java?
  • What do you know about the Externalizable interface?
  • Explain Daemon Thread in Java.
  • What is enumeration in Java?
  • Why is Java dynamic?
  • Is it possible to run a code before the execution of the main method?
  • How often is the “finalize” method called in Java?
  • Define Polymorphism in Java.
  • What is Overloading in Java?
  • Explain Abstract class.
  • Differentiate between Array and Array List.
  • Differentiate between String, String Buffer, and StringBuilder.
  • What are Public and Private access specifiers?
  • What are the differences between Protected and Default access specifiers?
  • State the difference between HashMap and HashTable.
  • What are the JSP implicit objects?

    JSP provides 9 implicit objects by default. They are as follows:

    Object Type
    1) out JspWriter
    2) request HttpServletRequest
    3) response HttpServletResponse
    4) config ServletConfig
    5) session HttpSession
    6) application ServletContext
    7) pageContext PageContext
    8) page Object
    9) exception Throwable

    12 A single try block and multiple catch blocks can co-exist in a Java Program. Explain.

    One or more catch blocks can follow a try block. Each catch block must have a unique exception handler. So, if you want to perform multiple tasks in response to various exceptions, use the Java multi-catch block.

    Q1 What are the important methods of Java Exception Class?

    Exception and all of it’s subclasses doesn’t provide any specific methods and all of the methods are defined in the base class Throwable.

  • String getMessage() – This method returns the message String of Throwable and the message can be provided while creating the exception through it’s constructor.
  • String getLocalizedMessage() – This method is provided so that subclasses can override it to provide locale specific message to the calling program. Throwable class implementation of this method simply use getMessage() method to return the exception message.
  • Synchronized Throwable getCause() – This method returns the cause of the exception or null id the cause is unknown.
  • String toString() – This method returns the information about Throwable in String format, the returned String contains the name of Throwable class and localized message.
  • void printStackTrace() – This method prints the stack trace information to the standard error stream, this method is overloaded and we can pass PrintStream or PrintWriter as an argument to write the stack trace information to the file or stream.
  • Difference between Applets and Swings | Core Java Interview Questions | Naresh IT

    Related Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *