Searching for "u"

Q:

I do not want my class to be inherited by any other class. What should i do?

Answer You should declared your class as final. But you can't define your class as final, if it is an abstract class. A class declared as final can't be extended by any other class.
Report Error

View answer Workspace Report Error Discuss

Subject: Java

Q:

What is the purpose of declaring a variable as final?

Answer A final variable's value can't be changed. final variables should be initialized before using them.
Report Error

View answer Workspace Report Error Discuss

Subject: Java

Q:

Which package is imported by default?

Answer java.lang package is imported by default even without a package declaration.
Report Error

View answer Workspace Report Error Discuss

Subject: Java

Q:

Can a source file contain more than one class declaration?

Answer Yes a single source file can contain any number of Class declarations but only one of the class can be declared as public.
Report Error

View answer Workspace Report Error Discuss

Subject: Java

Q:

Does the order of public and static declaration matter in main() method?

Answer No. It doesn't matter but void should always come before main().
Report Error

View answer Workspace Report Error Discuss

Subject: Java

Q:

What is the argument of main() method?

Answer main() method accepts an array of String object as arguement.
Report Error

View answer Workspace Report Error Discuss

Subject: Java

Q:

Should a main() method be compulsorily declared in all java classes?

Answer No not required. main() method should be defined only if the source class is a java application.
Report Error

View answer Workspace Report Error Discuss

Subject: Java

Q:

What is the return type of the main() method?

Answer Main() method doesn't return anything hence declared void.
Report Error

View answer Workspace Report Error Discuss

Subject: Java