ALLInterview.com :: Home Page KalAajKal.com
 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                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 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
we know that every java prog must follows OOPS Principles.
Anybody can answer, HOW THE FOLLOWING PROGRAM FOLLOWS OOPS 
CONCEPTS i.e, Inheritance,Polymarphism,Encapsulation?
class a{
public static void main(String args[]){
System.out.println("Hello World");
}
}

 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: we know that every java prog must follows OOPS Principles. Anybody can answer, HOW THE FOLLOWING PROGRAM FOLLOWS OOPS CONCEPTS i.e, Inheritance,Polymarphism,Encapsulation? class a{ public static void main(String args[]){ System.out.println("Hello World"); } }
Answer
# 1
Inheritance: Every class is extended of Object class, so in 
here a extends Object. this is Inheritance.

Polymorphism: means single entity multiple views.
here only one method is there. if here multiple views, then 
only it would become like Polymorphism concept.

Encapsulation: Wrapping up of data and code means methods, 
variables, code, and all. every java program is based on 
Encapsulation concept.
 
Is This Answer Correct ?    1 Yes 0 No
Sree
 
  Re: we know that every java prog must follows OOPS Principles. Anybody can answer, HOW THE FOLLOWING PROGRAM FOLLOWS OOPS CONCEPTS i.e, Inheritance,Polymarphism,Encapsulation? class a{ public static void main(String args[]){ System.out.println("Hello World"); } }
Answer
# 2
Java is Pure OOPS... Try writing a java program without 
Class. i.e. public class Test {}, In this way it satisfies 
Oops Concept.
Abstraction: Take any thing like static, system,etc. we 
don't know the internal functionalities, but by calling 
them we are achieving the task. Here it is hiding the 
complexities but representing essential features.
Encapsulation: By writing a program you are grouping all 
the methods, variables,etc there by satisfying Encapsulation
Inheritence: When reusability occurs, you satisfy this 
concept.
Polymorphism: We achieve it through Overloading and 
Overriding in Java in most of the concepts.
 
Is This Answer Correct ?    2 Yes 0 No
Srinivas Battula
 
 
 
  Re: we know that every java prog must follows OOPS Principles. Anybody can answer, HOW THE FOLLOWING PROGRAM FOLLOWS OOPS CONCEPTS i.e, Inheritance,Polymarphism,Encapsulation? class a{ public static void main(String args[]){ System.out.println("Hello World"); } }
Answer
# 3
1]here we use static main method means single copy of that
method is created in memory for that particular class means
we can not accept main method out side the class we can call
this method by using class name,ie javac a.java means this is
ENCAPSULATION
2]here println is a method, its defination writen in out
that is output straem means we obtain
INHERITANCE
3]polymorphisum means one name many form basically base
class pointer in our example when u pass String args[] to
main but can manipulate all type of data inside main this is
POLYMORPHISUM
 
Is This Answer Correct ?    1 Yes 0 No
Dhawal
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
How to find the size of an array a)array.length() b)array.length c)array.size() d)array.size Accenture6
What is dynamic binding?  2
watz the difference between abstract class and interface? Which one u ill choose as a designer? Sonata1
In Java why we write public static void main(String args[]) why not main()? TCS12
Name the method that used to clear the buffer ?  2
List interface?  2
Can we place the any object to key attribute of HashMap<key,value>? HCL3
whats is the use of final,in which situation final can be used in the application? DNS2
how you will prevent method overriding? HCL4
why java not supproting multiple inheritance?  5
For which statements we use a label? Wipro3
How are Observer and Observable used?  2
Hi Friends, Can u give few interview questions which relates ArrayList and Hashmap. I mean how to link ArrayList and HashMap.I know this is not good way of asking questions like this , but i need Microsoft1
What is interface and its use? HCL6
when we write class.forName("any one class"); what happens actually?what it will return?explain stepwise?  5
10. class Nav{ 11. public enum Direction { NORTH, SOUTH, EAST, WEST } 12. } 13. public class Sprite{ 14. // insert code here 15. } Which code, inserted at line 14, allows the Sprite class to compile? a)Direction d = NORTH; b)Nav.Direction d = NORTH; c)Direction d = Direction.NORTH; d)Nav.Direction d = Nav.Direction.NORTH;  1
what is the difference b/w PUT and POST method to send data to the server Mind-Tree2
what is the purpose of the final in the try-catch-final  5
What is the preferred size of a component?  1
How will you convert an ArrayList to Arrays? KPIT3
 
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 © 2007  ALLInterview.com.  All Rights Reserved.

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