diff --git a/error_help/e2.txt b/error_help/e2.txt index 84cd4503..cd7b91ce 100644 --- a/error_help/e2.txt +++ b/error_help/e2.txt @@ -1,9 +1,16 @@ -To define a class use the following syntax +Error #2: Syntax error in the class definition -class name: - "Your code here" +Example: +To define a class, use the following syntax: -To define a class with multiple inheritance use the following syntax + class : + [Your code here] -class name(object1,object2): - "Your code here" \ No newline at end of file +To define a class with multiple inheritance, use the following syntax: + + class (,): + [Your code here] + +In the above examples: +1. Text written between <> is changeable as per requirement. +2. Code goes between []. diff --git a/error_help/e3.txt b/error_help/e3.txt index 556197a8..bddfc5cd 100644 --- a/error_help/e3.txt +++ b/error_help/e3.txt @@ -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): - ... \ No newline at end of file +A class can only contain variable or methods or nested class/union or enum. + +Example: + class iterate_test: + int = 0; + + class : + [Your code here] + + enum : + a,b,c + + 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 []. diff --git a/error_help/e4.txt b/error_help/e4.txt index 42f22666..2cb378cc 100644 --- a/error_help/e4.txt +++ b/error_help/e4.txt @@ -1,5 +1,12 @@ -A virtual function can be declared inside a class only. Here is an example:- +Error #4: Virtual function cannot be declared outside the class. -class name: - virtual __init__(self): - ... \ No newline at end of file +A virtual function can only be declared inside a class. + +Example: + class : + virtual __init__(self): + [Your code here] + +In the above example: +1. Text written between <> is changeable as per requirement. +2. Code goes between [].