can we write program without class
Answers were Sorted based on User's Feedback
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 |
Answer / jain mayur
no we cant write any program without class.because its
purely object oriented.
| Is This Answer Correct ? | 6 Yes | 1 No |
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 |
Answer / poobalan
without creating class we will not wtite a program.
| Is This Answer Correct ? | 2 Yes | 2 No |
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 |
Does java linked list allow duplicates?
What is super keyword explain with example?
What are the differences between path and classpath variables?
when a request is generated from apache tomcat 5.5 and goes to oracle 10g or mysql,,, how the oracle or mysql reads the request as apache is a web server and oracle 10g is application server? when the oracle 10g provides response, how the apche tomcat reads it???
why we are calling j2se why not j1se or j3se or j4se..etc is there any reason.. can u please explain it... i shocked in my interview when they asked this question please explain ans
Is arraylist sorted in java?
How do you classify Dialog Box?
Can you make a constructor final?
What is difference between synchronize and concurrent collection in java?
What is anagram number?
Can try statements be nested?
Name the packages in JDK?