can we write program without class

Answer Posted / ashok reddy

2 ans for this question.

1.in a class class name and the constructor is must. so we cant write a file without class.(for this reason only the compiler adds a default constructor)

2.dont write anything inside a text doc(Empty text doc) and save this file as somename.java. it is possible to compile this file but it doesnot produce any .class file.

Is This Answer Correct ?    14 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of literals?

556


What is a war file?

544


What is the purpose of garbage collection in java, and when is it used?

559


Why you should not use singleton?

536


what is mutual exclusion? : Java thread

550






What does system out println () do?

553


Which collection is sorted in java?

542


How to change value in arraylist java?

495


How to check if linked list contains loop in java?

457


What is a JAR file?

590


What is mnemonic code?

535


What is java full form?

527


What is java console application?

556


Can constructor be inherited?

575


What is the use of isempty in java?

535