---
title: "Class"  
description: "Class"  
author: "ANkita gupta"  
published: 2015-05-07  
updated: 2020-08-31  
canonical: https://www.mindstick.com/interview/2495/class  
category: "java"  
tags: ["java"]  
reading_time: 2 minutes  

---

# Class

**WHAT IS** **SUBCLASSING**? IS IT SAME AS SUBCLASS OR THEIR IS DIFFERENCE?

## Answers

### Answer by ANkita gupta

we can define subclassing in this manner tooSubclassing involves creating a new class that inherits from some other class in the classhierarchy. Using subclassing, you only need to define the differences between your classand its parent; the additional behavior is all available to your class through inheritance.

### Answer by Anonymous User

Sub classing is done with the help of inheritance. It is done for design purposes\
Suppose you have a **Chair** class and you want to categories this further under **RevolvingChair** so, you need to ***extend*** the **Chair** class in **RevolvingChair** class.Now you only need to implement the revolving feature ***revolve()*** in your **RevolvingChair** class, the other chair features will be already included from the parent class i.e.**Chair** Class

```
public Class Chair{//chair properties// chair behavior and methods}
```

```
public class RevlovingChair extends Chair{//extra properties for revolving chair, it also includes the properties of Chair class, we don't need to implement it again here.// new methods (we don't need to implement chair methods here again)revolve()}
```

\
For further details:http://www.mindstick.com/Articles/2d57f8ff-6a32-416b-8c2f-e5ec44b5a335/Inheritance%20in%20Java#.VUuIYPmqqko \

### Answer by ANkita gupta

**WHAT IS** **SUBCLASSING**? IS IT SAME AS SUBCLASS OR THEIR IS DIFFERENCE?


---

Original Source: https://www.mindstick.com/interview/2495/class

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
