ALLInterview.com :: 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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
   
 
Categories  >>  Software  >>  Java Related  >>  Java J2EE  >>  Core Java
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
can we write a program with out a class in core java?
 Question Submitted By :: Anusha
I also faced this Question!!     Rank Answer Posted By  
 
  Re: can we write a program with out a class in core java?
Answer
# 1
no.. 
Is This Answer Correct ?    22 Yes 4 No
Shree
 
  Re: can we write a program with out a class in core java?
Answer
# 2
yes,an empty source file is compiled with out error,but it
will throw Runtime Exception when jvm will not find Main()
method.
 
Is This Answer Correct ?    18 Yes 2 No
Venkat Kanneganti
 
 
 
  Re: can we write a program with out a class in core java?
Answer
# 3
Yes, with the help of static block we can write a program.
static block executed first always
 
Is This Answer Correct ?    10 Yes 5 No
Navneet Raushan
 
  Re: can we write a program with out a class in core java?
Answer
# 4
no 
Is This Answer Correct ?    6 Yes 4 No
Pushpendra
 
  Re: can we write a program with out a class in core java?
Answer
# 5
yes we can write using interface 
Is This Answer Correct ?    5 Yes 2 No
Karthik
 
  Re: can we write a program with out a class in core java?
Answer
# 6
Noo way, every program should be write within class only 
Is This Answer Correct ?    0 Yes 3 No
Arjun
 
  Re: can we write a program with out a class in core java?
Answer
# 7
no... 
Is This Answer Correct ?    0 Yes 2 No
Yogesh
 
  Re: can we write a program with out a class in core java?
Answer
# 8
yes,by using static keyword 
Is This Answer Correct ?    1 Yes 0 No
Akshara
 
  Re: can we write a program with out a class in core java?
Answer
# 9
it is possible to create java program without userdefined class.

public enum AAA {

AAA;

public static void main(final String[] args) {
System.out.println("H");
}

}
 
Is This Answer Correct ?    3 Yes 0 No
Saran
 
  Re: can we write a program with out a class in core java?
Answer
# 10
yes,It is possible by using enum(which is a predefine class) 
Is This Answer Correct ?    2 Yes 0 No
Juned
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
when asub class inherits a super class and overrides a public method of super class in sub class(public method in super class). why these methods needs to be public in sub class. (otherwise compile time error).  3
how do you store phone numbers using java collections Bosch5
why string is not taking as primitive datatypes but we r taking it as a class? why explain it? HP2
What is interface and its use? HCL7
how can you retrive information from database by using hashmap/arraylist ,plz explain with example briefly? Satyam1
What is the Set interface?  2
how u do unit testing? iFlex2
Can we iterate through collection using for loop? Rolta2
1).what is the difference between below examples String s="vijay"; String s=new String("vijay"); TCS12
how to print output with out using sop statements UHG5
why we write public static void main (String args[]) in core java plz explain briefly?????????????????? HCL3
What is deadlock and how to avoid this?  2
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2012  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com