can we write program without class

Answers were Sorted based on User's Feedback



can we write program without class..

Answer / 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

can we write program without class..

Answer / jain mayur

no we cant write any program without class.because its
purely object oriented.

Is This Answer Correct ?    6 Yes 1 No

can we write program without class..

Answer / sitaram

class with out name is called ananamous class.

Is This Answer Correct ?    5 Yes 5 No

can we write program without class..

Answer / bhargavi rani

no.becoz java is pure object oriented language.so all the
member functions and datamembers must be write inside the
class.here we can also say that class is an example for
encapsulation.encapsulation is binding data and member
functions in a single unit.

Is This Answer Correct ?    2 Yes 2 No

can we write program without class..

Answer / poobalan

without creating class we will not wtite a program.

Is This Answer Correct ?    2 Yes 2 No

can we write program without class..

Answer / mahipal

no,because java is purely object oriented language,so we can't create the objects with out writing a class.And also we can save the code as classname.java that's the reason also we must create a class

Is This Answer Correct ?    3 Yes 4 No

Post New Answer

More Core Java Interview Questions

What things should be kept in mind while creating your own exceptions in java?

0 Answers  


What are the pillars of java?

0 Answers  


how to execute main()

4 Answers   Symphony, TCS,


Which software is used for java programming?

0 Answers  


What is the difference between access specifiers and access modifiers in java?

0 Answers  






v-model life cycle

0 Answers   Virtusa,


How is it possible in java programming for two string objects with identical values not to be equal under the == operator?

0 Answers  


How do you download stubs from Remote place?

0 Answers  


How to display all the prime numbers between 1 and 100

0 Answers  


Which is faster set or list in java?

0 Answers  


Add a value x to array from index l to r where 0 <= l <= r <= n-1

0 Answers   Amazon,


What methodology can be employed to locate substrings inside a string?

0 Answers  


Categories