Answered Questions

  • What is the purpose of hash code in Java?


    • Feb 28th, 2012

    At the time of creating object constructor will be execute it will tell the size of memory to the JVM and JVM will tell to the heap manager and heap manager will create the memory at that time heap manager will create one unique id is called hash code

  • System is a class or a package?

    class Test { public static void main(String... a) { System.out.println("hello world"); } } In the above code if we write "s" of String class in lowercase, it gives an error of class not found, but if we write "S" of "System" class in lower case it gives an error package not found. why?


    • Aug 10th, 2011

    System is a class which is available in lang package and we need not to create object. When we give System as system compiler searches in the package and gives an error.

    String is also a class and we can create objects to handle character strings and it is a reference datatype

  • Use of Static

    What is the use of static in (public static void main string args[])


    • Aug 6th, 2011

    Without creating instance of that class to invoke the main method static keyword is used, by giving the name of the class main method gets invoked.

  • What is meant by inheritance ? Explain with an example

    Shahnoor Alam

    • Aug 28th, 2017

    Inheritance is an OOPS concept by which a class can acquire the characteristics of another class. The class that does the inheriting is called a subclass. Therefore, a subclass is a specialized version of a superclass.