This is a line which has 1 dimension, that is length.
A rectangle however has 2 dimensions, which are length and breadth. So it is a 2D shape.
Let's have a look at some 3D shapes below:
A cube | A cuboid |
A cylinder | A cone |
A triangular prism | A pyramid |
So all 3D shapes must have depth to make them solid and all 3D shapes have volume.
As a conclusion, a 3D shape is a solid which encloses a volume and has length, breadth and height.