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:
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?
A computer platform can be considered as the environment in which a software code is executed.
A platform can be:
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: