Monthly Archives: February 2011

C# Basic (9)

1. Context Switching The processor uses a hardware timer to determine when a timeslice has ended for a given thread. When the hardware timer signals the interrupt, the processor saves all registers for the current thread onto the stack. Then the … Continue reading

Posted in C# | Leave a comment

C# Basic (8)

1. Operator overloading public static retval operator op ( object1 [, object2 ]) Keep in mind the following facts when using operator overloading: All overloaded operator methods must be defined as public and static. Technically, retval (the return value) can … Continue reading

Posted in C# | Leave a comment

C# Basic (7)

1. The application requests that the user type in a number between 1 and 10. A random number is then generated, and the user is told whether the number they picked matches the random number. using System; class IfTest1App { … Continue reading

Posted in C# | Leave a comment

JDK install

Control Panel->System and Security-> System->Advanced System Setting ->Environmental Variables -> New  (give name and path) and at System part, choose path, then add ;%JAVA_JDK%\bin

Posted in Uncategorized | Leave a comment

C# Basic (6)

1. An operator is a symbol that indicates an operation to be performed on one or more arguments. The values being operated on are called operands. The most basic C# operators include multiplication (*), division (/), addition and unary plus (+), … Continue reading

Posted in C# | Leave a comment

C# Basic (5)

1. When you define an interface and specify that a class is going to make use of that interface in its definition, the class is said to be implementing the interface or inheriting from the interface. In C#, an interface is … Continue reading

Posted in C# | Leave a comment

C# Basic (4)

1. Defining and using Properties class Address { protected string city; protected string zipCode; public string ZipCode { get { return zipCode; } set { // Validate value against some datastore. zipCode = value; // Update city based on validated … Continue reading

Posted in C# | Leave a comment

C# Basic (3)

1.Read-Only Fields public readonly int ScreenWidth; So what does a programmer do when the need arises for a field with a value that won’t be known until run time and should not be changed once it’s been initialized? When you define … Continue reading

Posted in C# | Leave a comment

C# Basic (2)

1. int foo = 42; // Value type. object bar = foo; // foo is boxed to bar. int foo2 = (int)bar; // Unboxed back to int. Notice that when boxing;that is, once again, when converting from a value type … Continue reading

Posted in C# | Leave a comment

C# Basic (1)

1. String str = System.Console.ReadLine(); cause the application to pause until you have pressed the Enter key. Insert this line before the end of each application. 2.Main Every C# application must have a method named Main defined in one of … Continue reading

Posted in C# | Leave a comment