Sunday, September 18, 2011

[Research] Visual Basic - The Object Class


There is a class called X that contains the following overridable methods:
Run()
Walk()
Hide()
There is a class Y that inherits from class X. Is Y able to override the Run, Walk & Hide methods in X?
Yes, Y can override the methods from class X, since X is the parent. X can call it's own functions even if Y overrides them, but Y if it overrides X's methods cannot access X's original methods only the newly written overriding one.

[Code] Visual Basic - GameSignUp Inheritance

What is the base class of the user class (GameSignUp.vb) you have created?
GameSignUp is based solely off the Object class.


Which methods does your user class (GameSignUp.vb) inherit from this class?
Equals(Object)
Equals(Object, Object)
Finalize()
GetHashCode()
GetType()
MemberwiseClone()
ReferenceEquals()
ToString()

[Research] Visual Basic - ToString

The ToString for my GameSignUp class output "GameSignup.GameSignUp". This was actually fairly useful as it states the owner and the class, so I can tell it is an object of GameSignUp in the solution GameSignup.

[Research] Visual Basic - The Object Class

What is the purpose of the object class?
The Object class is the ultimate "parent" class, all objects are based off it. It's the root of type hierarchy.

How many constructors does it contain?
Just one.

How many methods does it contain?
It contains 8 methods.

What is the purpose of the ToString method?
ToString outputs a string that is basically the "name" of the object.

Monday, September 5, 2011

[Research] Visual Basic - Debugging (Types of Errors)

There are 3 types of Programming errors;
Syntax - Literally the user writing bad code, or code the compiler does not understand. An example of this is that you cannot write a Procedure block within a Namespace block.
Run-Time - Errors that appear as the program runs, due to errors that were not picked up by syntax, eg giving a function bad parameters.
Logic - These are not "Errors" that the compiler throws, rather, unwanted output. Eg, dividing a rectangle's width by height to get area instead of multiplying them.

The Error List window displays Syntax errors.