what is different between static and non static methods ,using
example
Answers were Sorted based on User's Feedback
Answer / siva
we should create object form calling Non static method but
no necessary to create object for calling static method
using class name we call static method
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / guest
Static:
we dont have to create instance of an object
Staic methods cannot access nonstatic methods.
same with variable static variables cannot access static
variables
Non-Static:
we have to create instance of an object
nonStaic methos canaccess nonstatic methods.
same with variable nonstatic variables can access static
variables
| Is This Answer Correct ? | 0 Yes | 1 No |
how you will prevent inheritance is there any other way other than inheritance?
What is string builder in java?
What design pattern you have used in your project? I answered Factory pattern, how it is implemented? What are its advantage? Do know about Abstract Factory?
What happens when a class is made static like if a field or member is made static it becomes class variable and is shared by all the object of the class?
Can we force garbage collector to run ?
Which data type is a class in java?
why abstract class does not have object creation
Hey buddy.. can you please tell me about the use of marker interface? And is there any link between marker interface and factory methods? Thanks in advance.
How to sort a vector elements that contains the user define class object? (Note: If Suppose consider, A Student class contain two data members. They are String studentName and int rollNo. I am creating Four objects for this class, each object contains students details like name and roll no. Now i am storing that objects in vector and if i retiving the elements from the vector means then it should be display in sorting order)
3 Answers ProdEx Technologies,
What is the purpose of a statement block?
Explain some best practices you would apply while using collection in java?
What is the difference between I ++ and ++ I in java?