I.T. Discussion Community!
-Collapse +Expand
C#
Search C# Group:

Advanced
-Collapse +Expand C# To/From
To/FromCODEGuides
-Collapse +Expand C# Study Test
PRESTWOODCERTIFIED
-Collapse +Expand C# Store
PRESTWOODSTORE
   ► KBProgrammingC#Language Basics   Print This     

C# KB: Language Basics Topic



19 Articles Found in the Language Basics Topic 

  KB Article    

Stephen Berry
1. Associative Arrays in C# (a Dictionary)

A Dictionary is a data type which maps a key to a value. The key and the value can be any type, the Dictionary shows the link between the two.

This example shows the relationship between the 3-letter airport code and their location. The code will produce a message box which says "Los Angeles."

11 years ago
(2 Comments , last by funny.j )

Code
Nothing New Since Your Last Visit
13925
Hits

C# (Visual C# & VS.Net)

Wes Peterson
2. Attribute An attribute is a "shorthand" mechansim for having additional metadata included in your assembly.
12 years ago, and updated 11 years ago

Definition
Nothing New Since Your Last Visit
10598
Hits

C# (Visual C# & VS.Net)

Stephen Berry
3. Boxing and Unboxing

Boxing is the conversion of a value type to the object type (or to any interface type that is implemented by the value type). Unboxing is the conversion from an object type to a value type (or from an interface type to any value type that is implemented by the value type).

11 years ago, and updated 10 years ago

KB Post
Nothing New Since Your Last Visit
8249
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
4. C# Code Blocks ({ })

For C#, I prefer to put the opening { and the closing } on their own line (as opposed to C++, Java, and JavaScript where I put the opening bracket at the end of the first line.

11 years ago, and updated 10 years ago

Code
Nothing New Since Your Last Visit
7068
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
5. C# Custom Routines
ReturnType RoutineName()

 

Note: C# requires () in both the function declaration, and when it's invoked.

11 years ago, and updated 11 years ago

Code
Nothing New Since Your Last Visit
7956
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
6. C# Development Tools

Languages Focus: Development Tools

Primary development tool(s) used to develop and debug code.

C# Development Tools

Microsoft Visual C# and the full version of Microsoft Visual Studio.Net are the current primary tools. CodeGear does have C#Builder but it's not a primary tool currently and development on the tool has slowed in recent years.

11 years ago, and updated 10 years ago

Code
Nothing New Since Your Last Visit
6586
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
7. C# End of Statement (;)

C# uses a semicolon ";" as an end of statement specifier and you can put multiple statements on a single line of code if you wish as well as split a single statement into two or more code lines.

11 years ago, and updated 10 years ago

Code
Nothing New Since Your Last Visit  
7661
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
8. C# Exception Trapping (try...catch...finally)

C# uses a try...catch...finally statement to trap for errors.

try {}
catch {}
finally {}
11 years ago, and updated 10 years ago
(1 Comments , last by Paul.L4 )

Code
Nothing New Since Your Last Visit
8618
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
9. C# If Statement (if..else if..else)

Use () around evaluation with no "then".

11 years ago, and updated 10 years ago

Code
Nothing New Since Your Last Visit
6421
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
10. C# Inheritance (: ParentClass)

Simple syntax example of class inheritance.

11 years ago, and updated 10 years ago

Code
Nothing New Since Your Last Visit
8844
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
11. C# Literals (quote)

Literals are quoted as in "Prestwood". If you need to embed a quote use a slash in front of the quote as in \"

11 years ago, and updated 10 years ago

Code
Nothing New Since Your Last Visit
8030
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
12. C# Logical Operators

Same as C++ and Java. C# logical operators:

& and, as in this and that No Short Circuit
&& and, as in this and that short circuits
| or, as in this or that No Short Circuit
|| or, as in this or that short circuits
! Not, as in Not This
^ either or, as in this or that but not both

10 years ago

Code
Nothing New Since Your Last Visit
9338
Hits

C# (Visual C# & VS.Net)

Stephen Berry
13. C# Null-Coalescing Operator: ??

The null-coalescing operatior ?? is used to assign a default value for nullable value types or reference types. This operator prevents exceptions from being thrown when trying to assign a nullable type to a non-nullable type.

For example, this code will throw an exception.

int? x = null;
int y = x;

However, this code will assign the default value of -1 to y:

int? x = null;
int y = x ?? -1;
11 years ago, and updated 10 years ago
(1 Comments , last by Paul.L4 )

Definition
Nothing New Since Your Last Visit
8599
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
14. C# Overloading (implicit)

C# Overloading

  • Operator - Yes.
  • Method - Yes.
11 years ago, and updated 10 years ago

Code
Nothing New Since Your Last Visit
11089
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
15. C# Parameters

Defining
In C# the data type of each parameter must be specified, even if adjacent parameters are of the same type.

11 years ago, and updated 10 years ago

Code
Nothing New Since Your Last Visit
6692
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
16. C# Substring

C# Substring

Above returns "abcd" on a string literal. You can, of course, use VarName.Substring(0, 4).

11 years ago

Code
Nothing New Since Your Last Visit
9415
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
17. C# Unary Operators

An operation with only one operand (a single input). The following are the C# unary operators: +, -, !, ~, ++, --, true, or false.

11 years ago, and updated 10 years ago

Code
Nothing New Since Your Last Visit
8850
Hits

C# (Visual C# & VS.Net)

Mike Prestwood
18. CSharp Language Specification (C#) http://msdn.microsoft.com/en-us/library/aa664628(VS.71).aspx
11 years ago

Link
Nothing New Since Your Last Visit
5686
Hits

C# (Visual C# & VS.Net)

Stephen Berry
19. Nullable Type Nullable types are instances of System.Nullable(T). A Nullable type can represent any of the normal values for its value type or it can be assigned the value null. This is useful when dealing with databases that may have types that do not have a value.
11 years ago

Definition
Nothing New Since Your Last Visit
9116
Hits

C# (Visual C# & VS.Net)

Icon Legend:
Recent or not:
- Recent activity (within last two weeks).
- No activity last two weeks.
 Since your last logged visit:
- New to you or updated since your last visit (sign in now to activate).
- NOT new to you since your last visit (sign in now to activate).

New C# (Visual C# & VS.Net) Knowledge Base Post...

Share your knowledge with the WORLD! In addition to adding comments to existing posts, you can post knowledge you've acquired. We welcome full articles (intro with screen shots), general posts (shorter), and tidbits (tips, FAQs, definitions, etc.).

Post New...

Tidbit Post: Short Flashcard FAQ Definition Quick Tip Code Snippet
Longer Post: Full Article General Post File Link Error News
Other: Blog Topic
Or, if YOU have a question...
  C# (Visual C# & VS.Net) Message Board
Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech