You are browsing the archive for C Training.
Difference between == and Object.Equals Method in C#
protected void Page_Load(object sender, EventArgs e) { object s1 = “abc”; object s2 = “abc”; if (s1 == s2) { Response.Write(“value of s1 and s2 are equal”); } else if(s1.Equals(s2)) { Response.Write(“Address of s1 and s2 are equal”); } /*************************************************************** * 1.==compares values of the variables. * 2.Object.Eqals Method compares address of the variables * [...]
is and as operators in C#
is Operator: is operator Checks if an object is compatible with a given type An is expression evaluates to true if the provided expression is non-null, and the provided object can be cast to the provided type without causing an exception to be thrown. as Operator: The as operator is used to perform conversions between [...]
Ternary Operators in C#
Ternary operators can be use full when we have only one simple if else condition. Ternary Operator Syntax: condition ? first_expression : second_expression; Ex: public class TernaryEx { public int GetBigNum(int a, int b) { return a > b ? a : b; //in the above syntax if a is greater than b //the above expression [...]
Custom Exceptions in C#
In C# all Custom Exception should be inherited from a class called as ApplicationException. In the below sample i created a Custom Exception class called CustSalException. I am raising an Exception when some creates an object of Salary class by passing salary value less than 5000. Please see the below code for the sample. In the code we [...]
Dotnet supported platforms
Dotnet is supported in the below platforms. Windows 98 or later versions Linux and Mac OS ( Linux and Mac are supported by using Dotnet MONO Project) Note: Sign Up For .NET Training Dotnet supported platforms is a post from: techpalle.com Dotnet supported platforms is a post from: techpalle.com Tags: Training Dotnet
How to debug Android program.
How to debug android program Go to Run -> debug configuration. Select your application and press debug. [or] you can right click on your project -> debug as -> Android application. Before running in debug mode, set break points where all it may be needed for your code. To set break points, go to the [...]
Types of JIT Compilers in .NET
There are 3 types of .Net Compilers present in .Net Framework. Pre-JIT (Compiles entire code into native code at one stretch . In .Net it is called as Ngen.exe) Ecno-JIT (Compiles code part by part freeing when required) Normal JIT (Compiles only that part of code when called and places in cache) Types of JIT [...]
Android – How does olden days telecom programs differs with Android ?
Olden days embedded [or] telecom domain programming difficulties. Coding in C/C++ in low level is very difficult. Need to understand low level architecture of how they are using Proprietary software’s for mobile were giving high priority to native apps than third party applications. Symbian and brew platforms were better compared to other platforms, they gave [...]