what is difference between class and object?
Answers were Sorted based on User's Feedback
Answer / ayush
collection of objects is class.
when object is a instance of class
Is This Answer Correct ? | 9 Yes | 0 No |
Answer / hamid khan växjö swe
Actually object is an obstraction of something in a problem
domain which reflecting the capabilities of a system to
keep information about it.
Is This Answer Correct ? | 25 Yes | 18 No |
Answer / deepak
class is a collection of its instance members like
variables and method. Objects are declared in the class.
Objects are nothing but a entity which keeps the refrence.
Is This Answer Correct ? | 7 Yes | 2 No |
Answer / ovn
•class is collection of objects.object is a real world
entity.
Class is template for an object and object is a instance of
a class.
•Class defines object but object cannot define a classes.
•Class cannot be passed as a parameter or arguments, but
object can be passes as parameter or argument.
•Object should be belonging to any of class.
•Object can create or delete as your necessity.
•Attributes and behaviors of class can access with the help
of objects.
attribute and beheviours of class can access with the help
of objects.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / deen muhammad
I think a class is the superset of an object and object is
subset of a class.
A class contain so many objects but an object only belongs
to one class
example: A human being is a class while its body parts are
the objects of that class.
Is This Answer Correct ? | 11 Yes | 8 No |
Answer / tamanna yesmin(jagannath unive
Objects contain data and code to manipulate that data where
the entire set of data and code of an object can be made a
user defined data type using the concept of a Class.
A class
may be thought of as a"data type" and an object as
a"variable"of that data type
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / maurya
class is a totally logical perseption while we r making a
class we think only WHAT and HOW. but an object is fully
physical perseption when we create an object we get th
physical entity of class. object has its existance but a
class dont.
through WHAT of a class we define state ie. what should be
in my object and through HOW we define behavior of object
ie. how and what function perform on my object to change
its behavior.
an object is actually type of class.....!!
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / malathi
classes is a combination of member function & data member
&methods into a single unit.It is also known as data
encapsulation.
objects is a variables to the class or instance of a
class.It is also known as data abstraction.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / santosh
OBJECT:-instance of class is called object.
CLASS:-group of object is called class.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / zishan shaukat
I think class is a room full of tables and chairs with n
number of students sitting inside it and a teacher teaching
them something on the blackboard.
Wheras individual commodities like table ,chair blackboard
chalk pen and paper are objects.
Is This Answer Correct ? | 2 Yes | 0 No |
what is difference between interface and abstract class..?
if a java file without any source code is valid java file?
Features of Java?
How to reverse string in java?
What are loops in java?
What is treemap in java?
What does i ++ mean in Java?
What is the purpose of a parameter?
What is variable and example?
Is string passed by reference in java?
Difference between hashCode() & equals()?
2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?