answersLogoWhite

0

A class is basically a definition, and contains the object's code. An object is an instance of a class. For instance, there is one java.lang.String class, but you can instantiate any number of distinct java.lang.String objects (instances). While a class defines the instance variables than an object has, the instantiated object itself actually contains those variables. So to put it simply: An object is an instance of a class.

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Why constructor use in java?

To create objects of classes


Did java oriented language works on object?

Java is an object oriented language, and it works with classes and objects.


What is Difference between java and core java?

Java or Java SE comes with the standard library, with all the crazy classes to make life easy. Java Core does not come with most of these classes, so that it is a lot smaller.


Why we write java program using classes?

Classes are well organised functions in java which help discriminate between two different functions.


Do the primitive datatypes in java have objects?

No Primitive data types do not have objects. As of Java 1.5, all primitive types in Java have "wrapper" classes. These classes serve two purposes: # They keep all type-specific methods together in one place. # They allow primitive types to be used in situations which take advantage of generics (also introduced in Java 1.5).


What are sealed classes in java?

Final classes are sealed classes in java I guess.


Differences between Java Applet and Java Beans?

Java applet is a program used to run java applications while beans is a compiler used to design java programs (IDE, GUI) :-) GilbertC


What are the differences between C and Java reference variables?

Java does not have the concept of Reference Variables. We cannot access the memory location where the data is stored in Java.


Can always create objects of all types of classes?

Of course, JAVA programming has a stricter syntax format than C++


Is there any difference between java and j2SE?

Core Java and J2SE are the same thing, which is the set of classes to be found in the rt.jar package. The classes were just given different names at different stages of the continued revisions to the Java Runtime Environment.


What is difference in use between interfaces and abstract classes in java?

While neither abstract classes nor interfaces can be instantiated in Java, you can implement methods in abstract classes. Interfaces can only define methods; no code beyond a method header is allowed.


What is a collection of related classes called in java?

a package