:: 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 (1722)
 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 (147)
 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
When garbage collector invokes object?s finalize() method?   5
How to know the host from which Applet is originated? Wipro 1
difference between String a; and String a=new String();? y do v need to assign memory to the variable?   2
There are 2 different ways to create an object. a)By using keyword "new" b)By using Class.forName ("className").newInstance(); What is the difference between these 2 methods.   3
What are Access Specifiers and Access Modifiers. TCS 6
What is the difference between interpreter and compiling ? TCS 7
what is session facade ?   3
What are different type of access modifiers?   3
Hi, This is ravi i have a question like this i have string "UNDERSTAND" now i want to count the letters how many times it occures.i.e from the above string the out put should be like this U-1,N-2,D-2,E-1,R-1,S-1,T-1,A-1. how can i achieve this Thnaks in advance for your response ..   7
What is an anonymous class? IBM 1
Can we iterate through collection using for loop? Rolta 2
What is "Java Native Interface" and how to use it? IBM 1
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.   ::