Java Basic Interview Question

Java Interview Question Set4

What is method and its purpose in java?

A method is a block containing group of statement that performs some specific task. A method can be called multiple times based on the requirements in the program.

We can have two types of methods in java:

  1. Simple method
  2. Parameterized method

Java provides lots of in-built methods as well like main() method, string methods (strlen(), toUpper(), etc), thread methods(wait(), notify(), etc)


To learn in details about method, examples, use and advantage visit method chapter of our java tutorial

What is platform?

computer platform can be considered as the environment in which a software code is executed.

A platform can be:

  1. Harware application
  2. Software application

A computer platform helps host application or services.


Java is a programming language and platform

Can we save our class name as .java?

Yes, we can save our class name as .java.

The .java class will compile and execute as normal. 


Its only knowledge based question.

We don't recommend naming your class as shown in the question. Rather provide a suitable and purposeful name to your class.

What is the super class of all the class in java?

java.lang.Object is the base class of all the classes in java.

Name some of the methods of java.lang.Object class?

Some of the methods provided by Object class are:

  • getClass()
  • hashCode()
  • equals(Object o)
  • toString()
  • finalize()
  • clone()
  • wait()
  • notify()
  • notifyAll()



Please Share this page
Views : 117
Like every other website we use cookies. By using our site you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more Got it!