Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,960 --> 00:00:02,790
A class can be abstract.
2
00:00:05,090 --> 00:00:08,390
You can create an object of a concrete class.
3
00:00:10,710 --> 00:00:13,800
You cannot create an object of an abstract class.
4
00:00:16,410 --> 00:00:19,410
In this lesson, you will label your parent class abstract.
5
00:00:22,260 --> 00:00:27,090
Now, the main problem is you shouldn't be allowed to create an object of the product class.
6
00:00:31,800 --> 00:00:37,500
Right now, product is a concrete class, which means we can create an object of the product class.
7
00:00:37,970 --> 00:00:40,410
I could write something like product product.
8
00:00:42,410 --> 00:00:44,810
Is equal to a new object of the product class.
9
00:00:46,860 --> 00:00:49,230
That is, let's say, for 99 blue.
10
00:00:50,620 --> 00:00:52,600
And I don't know, just put Java for the brand.
11
00:00:56,300 --> 00:00:57,140
Now, here's the issue.
12
00:00:59,730 --> 00:01:04,200
The requirements state that your clothing store sells shirt and pants.
13
00:01:06,500 --> 00:01:08,990
So what's product what are we selling here?
14
00:01:09,020 --> 00:01:10,610
Is it a shirt or is it pants?
15
00:01:10,640 --> 00:01:11,440
We don't know.
16
00:01:11,960 --> 00:01:16,700
That's why we need to forbid the color from creating an object of the product class.
17
00:01:18,120 --> 00:01:19,050
How do we do that?
18
00:01:19,320 --> 00:01:26,940
You make the class abstract, you cannot create an object of an abstract class, make a class abstract
19
00:01:26,940 --> 00:01:29,130
if its only purpose is inheritance.
20
00:01:31,430 --> 00:01:33,800
So we're going to make the product class abstract.
21
00:01:41,150 --> 00:01:41,800
And that's it.
22
00:01:43,670 --> 00:01:46,940
And now the color isn't allowed to create an object of it anymore.
23
00:01:47,120 --> 00:01:51,530
The only purpose of the product class is to provide inheritance for pants and shirt.
24
00:01:54,800 --> 00:01:57,500
You cannot create an object of an abstract class.
25
00:01:59,750 --> 00:02:03,740
Make a class abstract if its only purpose is providing inheritance.
2244
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.