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
When we can access the static data member without creating
the object what is the need of the object in java.
 Question Submitted By :: Abhishek_di02
I also faced this Question!!     Rank Answer Posted By  
 
  Re: When we can access the static data member without creating the object what is the need of the object in java.
Answer
# 1
Object is needed to access a non static data member
 
Is This Answer Correct ?    2 Yes 1 No
Avadhut Rane
 
  Re: When we can access the static data member without creating the object what is the need of the object in java.
Answer
# 2
U cant call other class method without object.static member 
is common for all object.if u want set some values for 
specific object then the object is necessary
 
Is This Answer Correct ?    2 Yes 0 No
Vijay
 
 
 
  Re: When we can access the static data member without creating the object what is the need of the object in java.
Answer
# 3
Static data is class  level data,while objects contain 
values of non static instancs varibles.
diffrent object contains diffrent values of instance 
varibles ,
but all object can share same vale of static data.

Class abc{
int i;
int j;
static int x=10;
//-----some more code
}

diffrent object contain diffrent values of i&j,
but all object can share one value of x(ie 10 coz it is 
static).

static data is accessed by class name and object also.
 
Is This Answer Correct ?    1 Yes 0 No
Paras Bist
 
  Re: When we can access the static data member without creating the object what is the need of the object in java.
Answer
# 4
The question is "when we can access the static data member
with out creating object?

To access a static member of data we no need to create an
object, using class name we can access that static data member.

What is the need of the object in java?

Object is required to access the instance variables as well
as instance methods in the class.With out the object we
can't access them.
 
Is This Answer Correct ?    0 Yes 0 No
Viswa
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What is user defined exception?  4
what is an object class?Explain its methods?  3
Why Wait and notify are kept in Object class although they are used only with Thread Class Saksoft2
why java does not support multiple inheritance Mind-Tree14
Howmany address lines are required to addressing 1 MB memory?  2
what is mean by overriding in which situation we wil use? Atlas-Systems4
Functionality of JVM? Infosys4
what do you meant by Runtime Polymorphism? Persistent10
Nullpointer exception is a very common exception. Why is it not made as a checked exception? Ness-Technologies1
if arraylist size is increased from initial size what is the size of arraylist...suppose initial is 100 , if i add 101 element what is the size...  6
Name the methods that used to get and set the text label displayed by a Buttonobject?  1
What are inner and anonymous class?  2
What is the difference between Trusted and Untrusted Applet ? IBM1
Which characters are allowed to use as the second character of an identifier, and which characters are not allowed?  2
What is an event?  1
write a progam hashmap & hashtable? IBM2
what is the use of custom tags? with example? Photon1
what is real-time example of runtime polymorphism and compile time polymorphism  1
What is Session and cookies?Explain in detail with an example? CTS2
A class can be a subclass of itself? Genesis2
 
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