This repository has been archived by the owner on Nov 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f4ce8f
commit 8ff9e6c
Showing
1 changed file
with
23 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
A class can only contain variable or methods or nested class/union or enum | ||
Error #3: Class contains something other than variables, methods, nested class/union or enum. | ||
|
||
Example:- | ||
class iterate_test: | ||
variable:int=0 | ||
class nested_class: | ||
... | ||
enum nested_enum: | ||
a,b,c | ||
union nested_union: | ||
x:int | ||
y:float | ||
def __init__(self,c): | ||
... | ||
A class can only contain variable or methods or nested class/union or enum. | ||
|
||
Example: | ||
class iterate_test: | ||
int <variable_name> = 0; | ||
|
||
class <nested_class>: | ||
[Your code here] | ||
|
||
enum <nested_enum>: | ||
a,b,c | ||
|
||
union <nested_union>: | ||
x:int | ||
y:float | ||
|
||
def __init__(self,c): | ||
[Your code here] | ||
|
||
In the above example: | ||
1. Text written between <> is changeable as per requirement. | ||
2. Code goes between []. |