CuriousTab
Search
CuriousTab
Home
Aptitude
Computer
C Programming
C# Programming
C++ Programming
Database
Java Programming
Networking
Engineering
Biochemical Engineering
Biochemistry
Biotechnology
Chemical Engineering
Civil Engineering
Computer Science
Digital Electronics
Electrical Engineering
Electronics
Electronics and Communication Engineering
Mechanical Engineering
Microbiology
Technical Drawing
GK
Current Affairs
General Knowledge
Reasoning
Data Interpretation
Logical Reasoning
Non Verbal Reasoning
Verbal Ability
Verbal Reasoning
Exams
AIEEE
Bank Exams
CAT
GATE
IIT JEE
TOEFL
Jobs
Analyst
Bank PO
Database Administrator
IT Trainer
Network Engineer
Project Manager
Software Architect
Discussion
Home
‣
Interview
‣
Technology
Comments
Question
Can a main() method be declared final?
Correct Answer
Yes Any inheriting class will not be able to have it's own default main() method
Technology problems
Search Results
1. What is the argument of main() method?
Show Answer
Scratch Pad
Discuss
Correct Answer: main() method accepts an array of String object as arguement
2. What is the return type of the main() method?
Show Answer
Scratch Pad
Discuss
Correct Answer: Main() method doesn't return anything hence declared void
3. Why is the main() method declared static?
Show Answer
Scratch Pad
Discuss
Correct Answer: main() method is called by the JVM even before the instantiation of the class, hence it is declared as static
4. Are arrays primitive data types?
Show Answer
Scratch Pad
Discuss
Correct Answer: In Java, Arrays are objects
5. Does Java support multiple inheritance?
Show Answer
Scratch Pad
Discuss
Correct Answer: Java doesn't support multiple inheritance
6. Does the order of public and static declaration matter in main() method?
Show Answer
Scratch Pad
Discuss
Correct Answer: No It doesn't matter but void should always come before main()
7. Can a source file contain more than one class declaration?
Show Answer
Scratch Pad
Discuss
Correct Answer: Yes a single source file can contain any number of Class declarations but only one of the class can be declared as public
8. Which package is imported by default?
Show Answer
Scratch Pad
Discuss
Correct Answer: javalang package is imported by default even without a package declaration
9. Can a class be declared as protected?
Show Answer
Scratch Pad
Discuss
Correct Answer: A class can't be declared as protected only methods can be declared as protected
10. What is the purpose of declaring a variable as final?
Show Answer
Scratch Pad
Discuss
Correct Answer: A final variable's value can't be changed final variables should be initialized before using them
Comments
There are no comments.
Enter a new Comment
Save
More in Interview:
Accounting and Finance
Administrative Assistant
Advertising and Media
Call Center
Common Interview
Competency Interview
Customer Service
Design and Fashion
Finance
Hospitality
Human Resources
Law
Leadership and Management
Manufacturing
Marketing and Sales
Medical and Health Care
Medical Assistant
Retail
Technology