473,396 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Beginner Question. What does the > mean? Not greater than.

I was looking at this code, and have seen it in other code (like it):

/// <summary>
/// Bitmap font class for XNA
/// </summary>
public class BitmapFont
{
private SpriteBatch m_sb;
private Dictionary<int, BitmapInfom_dictBitmapID2BitmapInfo;

and like:

m_dictBitmapID2Texture = new Dictionary<int, Texture2D>(); //what's
the paren mean too?

What does the < mean? What do I search on to understand what the
angle bracket symbols mean in a context like this? Thank you for any
help.

Sep 7 '06 #1
2 2308
It is Generics syntax, a new feature of .NET v2.0.
Check out C# 2.0 documentation.

ne***********@gmail.com wrote:
I was looking at this code, and have seen it in other code (like it):

/// <summary>
/// Bitmap font class for XNA
/// </summary>
public class BitmapFont
{
private SpriteBatch m_sb;
private Dictionary<int, BitmapInfom_dictBitmapID2BitmapInfo;

and like:

m_dictBitmapID2Texture = new Dictionary<int, Texture2D>(); //what's
the paren mean too?

What does the < mean? What do I search on to understand what the
angle bracket symbols mean in a context like this? Thank you for any
help.
Sep 7 '06 #2
<ne***********@gmail.coma écrit dans le message de news:
11**********************@i3g2000cwc.googlegroups.c om...

| What does the < mean? What do I search on to understand what the
| angle bracket symbols mean in a context like this? Thank you for any
| help.

private Dictionary<int, BitmapInfom_dictBitmapID2BitmapInfo;

This indicates that a generic Dictionary class is being "bound" to int, as
the key, and BitmapInfo, as the value, types.

Previously, to create a dictionary in .NET1.1, you would have had to use a
Hashtable and cast both the key and value to/from their real types to
System.Object. A generic class allows you to declare a class that can work
with many different types; in situations where the code remains the same,
only the type changes.

This is especially efficient because any operation that casts a value type
like an integer to System.Object also involves a boxing operation. Generic
classes like List<Tallow binding directly to the integer type as in
List<intto give you a list of integers that is typesafe and that does not
incur any boxing/casting penalty when adding/retrieving items.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Sep 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: hedylogus | last post by:
I've just begun learning C++ and I'm trying to write a program to shuffle a deck of cards. I've succeeded....for the most part....but every now and then rand() produces duplicate random numbers...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
27
by: Daniel Vallstrom | last post by:
I'm having problems with inconsistent floating point behavior resulting in e.g. assert( x > 0.0 && putchar('\n') && x == 0.0 ); holding. (Actually, my problem is the dual one where I get...
10
by: Bonj | last post by:
I almost understand TSTs, to the point where I just need to know the answer to this: When making a TST (in C++) that will have as its leaf nodes words that make up SQL language and an categorising...
9
by: David Eades | last post by:
Hi all Complete newbie here, so apologies if this is the wrong forum. I've been asked to use mysql and asp to make a simple bidding system (rather like a simple ebay), whereby users can use a...
5
by: Stan R. | last post by:
Greetings. I have a couple of questions concerning CSS layouts, as apposed to the old <tablemethod for creating layouts . Even after spending the last few days searching all over Google Groups, I...
4
by: jienweiwu | last post by:
The following is correct... #include <iostream> using namespace std; int main() { double BMI,height,weight; cout<<"Welcome to the BMI calculator!\n\n"; cout<<"Enter your weight(kilos): ";
9
by: Euvin | last post by:
Const Pi as Double Would you consider Double to be a Variable? And what does Double mean? What is its purpose?
13
by: Liang Chen | last post by:
Hope you all had a nice weekend. I have a question that I hope someone can help me out. I want to run a Python program that uses Tkinter for the user interface (GUI). The program allows me to type...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.