Visual basic (Of T, or Of V) [closed] - vb.net

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
When creating classes or other elements in VB.NET, for example :
Public Class Class1(Of T)
End Class
What does "(Of T )" mean in this code ?

(Of T) is a generic type parameter. It means that you can:
Refer to T in the class code, without knowing the type of T.
Construct instances of class Class1, passing any Type T into it.
This is used to construct classes, that can operate on different types, without knowing the type at compile time. This is, among other things, very useful for collection classes, where you are able to create the collection once (Example: List), and then create a List (Of String) or List(Of DateTime) and so on, for any specific type you might need.
Also, see this MSDN article on generics in VB.NET.

It means type parameter, it means that this class is capable of working with objects of a class that you specify during creation. For example List (Of T).

Related

execute objective-c method on document load [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Pretty confused newbie here:
I have a class, this class is adding columns to a table. In a first step this was done by hitting a button. I've added a generic object to the interface builder, assigned the class that adds the column to the table and made the connections; this way when I hit the button the columns are added. Now I need to modify this program and run the method whenever a document is loaded (document based application), so I need to call my method from inside the - (void)windowControllerDidLoadNib:(NSWindowController *)aController method. Now what confuses me is: how can I call a method of an object that is connected to the interface builder?
--- EDIT ---
If you feel you have to downvote, please at least say why! since I am a newbie what may sound like a stupid question for you is a pretty advanced question for me.
--- EDIT 2 ---
Probelm found, check my own answer.
You need to create an outlet. Control drag from IB (Interface Builder) to the View Controller.
I found what the problem is: my class adds column to the table by reading out informations from a NSarraycontroller. this NSArraycontroller is populated by the coreframework. but it is populated only AFTER the view is loaded so i cannot fill the tables at startup without using a timer or something like that!

Programming by using oops concept [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
can you give me a idea about the following program:
There is vehicle factory. The common attribute of all the vehicles are that they can run. Building the basic structure of any vehicle, it is required to pass wheel count, wheel size and factor. The max speed is defined by the multiplication of wheel count, size and factor.
The factory can build: Cycle, MotorCycle, Car, Bus.
When those vehicle run they print <Vehicle Name>can run at speed<Max Speed>
Please write a program using OO approach.
Factor:Cycle=1,MotorCycle=2,Car=4,Bus=6
Wheel Size:Cycle=10, MotorCycle=12, Car=12, Bus=20
What is the best way to do this?
Read between the lines:
They can run: refers to a method.
Building the basic structure: refers to a constructor, in fact it sums up the constructor parameters.
The max speed is defined by the multiplication of ...: a calculated property.
The factory can build ... sums up the subtypes of Vehicle. (As you already understood).
When those vehicle run they ... : tells you what the run method should do.
Then the constructor parameters are given, assuming you can figure out the wheel count.

why do you have to write interface and implementation in objective C instead just implementation [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I would like to know, why is so important to write interface and implementation for every calss in Objective C. In other langauge this technique is only optional.
In Objective-C, writing an interface is also optional (so is declaring methods), although the compiler will likely warn you. Writing the interface permits somebody else to reuse the binary form of your code without having to recompile it; this way you can also hide the implementation details/the code from the one who reuses your class. Also, if only you use your own class, the compiler may need some information at compile time (although Objective-C is a dynamic language) about the classes you write -- in this case you can't include the whole implementation file as it would result in duplicating your entire class, redulting in a linker error. Same reason why there are header files for any C library out there.
Interface describes how other classes and their instances will interact with your class and its instances. You could just create implementation, but that would kind of defeat the purpose of OOP.

Why do we use structure, property or Enum syntax? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I think it's substituable for just Dim, Public or others.
What is merit by using structure, property ??
All of these things you mention have different purposes.
Dim is used to create a local variable, which only exists in the function (method) you declare it in.
Public creates a member variable in a class. And it is accessible outside of the class.
A structure is like a class, but the differences between structs and classes depend on the language. In .NET, structs are value types, where as classes are reference types. See this for more information.
A property is like a public field, except it is modified through dedicated getter and setter 'functions'. These allow you to specify what is done with a value from a user, or how to calculate a value to return to the user.
An Enum is just an organized collection of constants, with a related purpose.
I think you should have a good read through an introduction on Visual Basic .NET like one of these:
http://visualbasic.about.com/od/learnvsnet/a/blecvbnet20101.htm
http://howtostartprogramming.com/vb-net/
http://www.java2s.com/Tutorial/VB/CatalogVB.htm

Explain class, method, function? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I am not clear what these terms mean:
Class
Method
Function
Can you please explain these terms to me?
You should first begin with Object Oriented development (maybe http://en.wikipedia.org/wiki/Object-oriented_programming). Because the class, method and function topics are not Java-specific.
Then you can see how Java works and how to build classes with it.
A class is a way of representing a group of objects. Sun/Oracle describes more about a class in What is a class? For example a car is a class of motorized vehicles with four wheels (among other things)
A method is a section of code that is declared to take some arguments (things like numbers) and return a value of a given type. A method has a body that determines what it does. Other parts of your code can call that method, at which point the code in your method is run and the return value can be used by the code doing the calling.
The word function is not really used when discussing Java, but if it is used it is a synonym for method.