Home - TahiraKiran456/Learning-Java GitHub Wiki

what is class?

A class is nothing but a blueprint or a template for creating different objects which defines its properties and behaviors.

What is object?

An object can be a variable, a data structure, or a function. In the class-based object-oriented programming paradigm, "object" refers to a particular instance of a class where the object can be a combination of variables, functions, and data structures.

Difference between class and object.

class.

1.Class is a blueprint or template from which objects are created. 2. Class is a group of similar objects. 3.Class is a logical entity. 4. Class is declared using class keyword e.g. class Student{}

Object.

  1. Object is an instance of a class.
  2. Object is a real world entity such as pen, laptop, mobile, bed, keyboard, mouse, chair etc. 3.Object is created through new keyword mainly e.g. Student s1=new Student();
  3. Object is created many times as per requirement.

Primitive data types.

There are eight primitive data types supported by Java. Primitive data types are predefined by the language and named by a keyword. Let us now look into detail about the eight primitive data types. Byte Short Int Long Double Character boolean Float

Non-primitive data types.

Non-primitive data types are not defined by the programming language, but are instead created by the programmer. They are sometimes called "reference variables," or "object references," since they reference a memory location, which stores the data. In the Java programming language, non-primitive data types are simply called "objects" because they are created, rather than predefined. While an object may contain any type of data, the information referenced by the object may still be stored as a primitive data type.