This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| public class Student | |
| { | |
| private int _id; | |
| private string _name; | |
| private const int PassValue = 70; //read only field | |
| public int Id | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Diagnostics; | |
| using System.Runtime.Serialization.Formatters; | |
| using System.IO; | |
| using System.Runtime.Serialization.Formatters.Binary; | |
| class Program | |
| { | |
| public static void Main() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| /* Important Static and Instance class member notes | |
| * | |
| * !@!@ Class members = fields, methods, properties, events, indexers, constructors, !@!@ | |
| * | |
| * Static members are invoked using the class name | |
| * Instance members are invoked using instances(objects) of that class | |
| * | |
| * An instance member belongs to a specific instance(object) of a class. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //classes, structs, enums, interfaces, delegates are Types | |
| //Types can only have internal, or public access modifiers | |
| public class Customer | |
| { | |
| //fields are type members | |
| #region Fields | |
| //three private fields, to encapsulate these private fields, we will make three public properties | |
| //these private fields are Type members, more specifically, type class members | |
| //type members can have all access modifiers (private, protected, internal, protected internal, public) | |
| private int _id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| /* Differences between Value Types and Reference Types | |
| * | |
| * Value Types: | |
| * All numeric data types | |
| * Boolean, Char, and Date | |
| * All Structures, even if the members of the struct are reference types | |
| * Enumerations, since their underlying type is always SByte, Short, Integer, Long, Byte, UShort, UInteger, or ULong | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections; | |
| /* Enumeration Notes | |
| * | |
| * Enums are value types | |
| * | |
| * Enums are strongly-typed constants | |
| * An explicit cast is needed to convert from enum type to an integral type and vice-versa. | |
| * An enum of one type cannot be implicitly assigned to an enum of another type -- even though the underlying value of their members are the same |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| //This code isn't very practical, but it demonstrates the Child class inheriting from it's base class. Place a breakpoint at the program entry (Main()) to see the control flow. | |
| public class Parent //this class will be inherited by class Child | |
| { | |
| public Parent() | |
| { | |
| Console.WriteLine("Parent Constructor"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Write a program that prints the numbers 1 to 100. For multiples of 3, print “Fizz” instead of the number. For multiples of 5, print “Buzz”. | |
| For numbers that are multiples of both 3 and 5 print, “FizzBuzz” | |
| */ | |
| for (var i = 1; i <= 100; i++) { | |
| if (i % 15 === 0) { | |
| console.log('FizzBuzz'); | |
| } else if (i % 3 === 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Write a program that prints the numbers 1 to 100. For multiples of 3, print “Fizz” instead of the number. For multiples of 5, print “Buzz”. | |
| For numbers that are multiples of both 3 and 5 print, “FizzBuzz” | |
| */ | |
| for (var i = 1; i <= 100; i++) { | |
| if (!(i % 3) && !(i % 5)) { | |
| console.log('FizzBuzz'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Let's start by creating the top level model. | |
| 1. Every Note has a Topic and a body. | |
| 2. Every Topic can have a Reply. | |
| This class will represent one instance of that topic. The next class will model the Reply. | |
| */ | |
| using System; |