:: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Categories >> Software >> Java Related >> Java J2EE >> Core Java


 Core Java interview questions  Core Java Interview Questions (1721)
 Advanced Java interview questions  Advanced Java Interview Questions (331)
 Swing interview questions  Swing Interview Questions (44)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (196)
 JDBC interview questions  JDBC Interview Questions (187)
 JMS interview questions  JMS Interview Questions (9)
 SunOne interview questions  SunOne Interview Questions (3)
 J2EE interview questions  J2EE Interview Questions (71)
 Weblogic interview questions  Weblogic Interview Questions (146)
 Websphere interview questions  Websphere Interview Questions (14)
 Java Networking interview questions  Java Networking Interview Questions (20)
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions (87)
can we write program without class
 Question Submitted By :: Core-Java
I also faced this Question!!     Answer Posted By  
# 1
2 ans for this question. 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 it is possible to compile this file but it doesnot produce any .class file.
Is This Answer Correct ?    13 Yes 6 No
Ashok Reddy
# 2
no we cant write any program without class.because its
purely object oriented.
Is This Answer Correct ?    6 Yes 1 No
Jain Mayur
# 3
class with out name is called ananamous class. 
Is This Answer Correct ?    5 Yes 4 No
# 4
no.becoz java is pure object oriented all the
member functions and datamembers must be write inside the 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
Bhargavi Rani
# 5
without creating class we will not wtite a program. 
Is This Answer Correct ?    2 Yes 2 No
# 6
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 that's the reason also we must create a class 
Is This Answer Correct ?    3 Yes 4 No

Other Core Java Interview Questions
  Question Asked @ Answers
what is Portal(web based online portal)? AIG 2
Static Variable can referred in non-static method?   3
How OOPS concept is achieved in Java? JPMorgan-Chase 6
all are saying java doesn't support multiple inheritance but by default Object class is super class for all the user defined classes and we can extend atmost one class so each class can extend more than one class so java supports multiple inheritance?i am confused with this,pls any one explain me.   8
What is exception and error? and what is the difference between them?   2
what really hapens when a object is created using new operator? it allocates memory to all variables and methods in the class with reference to that object?   3
what is Thread?   6
What is the differenc between Enemuration interface and iterator interface according to accessing?   4
what is for datainputstream?   1
I need help please send me reply: Write a program "if given a string like 'HAT', the combination's returned should be like ATH,THA,TAH in java"?   4
Can a double value be cast to a byte?   3
what is the diff between Servletcontext and servletconfig?   5
For more Core Java Interview Questions Click Here 

Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
Copyright 2013  All Rights Reserved.   ::