tag:blogger.com,1999:blog-79439699407908786162024-03-16T00:34:50.527+05:30Develop On- .Net FrameworkDevelop Onhttp://www.blogger.com/profile/09383947133712300352noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-7943969940790878616.post-77835826733683764162024-01-20T21:01:00.002+05:302024-01-20T21:01:18.741+05:30Object Oriented Programming- 2- Inheritance
Inheritance is one of the fundamental attributes of object-oriented programming.
It allows you to define a child class that reuses (inherits), extends, or modifies the behavior of a parent
class.
The class whose members are inherited is called the base class.
The class that inherits the members of the base class is called the derived class.
Muthukrishnan Ramasamyhttp://www.blogger.com/profile/04599863630954134276noreply@blogger.com0tag:blogger.com,1999:blog-7943969940790878616.post-42454131007103726582023-12-30T02:20:00.001+05:302024-01-15T18:38:53.793+05:30Object Oriented Programming- 1 C# is an object oriented programming language.
The four basic principles of object-oriented programming are:
Abstraction Modeling the relevant attributes and interactions of entities as classes to define an
abstract representation of a system.
Encapsulation Hiding the internal state and functionality of an object and only allowing access
Develop Onhttp://www.blogger.com/profile/09383947133712300352noreply@blogger.com0tag:blogger.com,1999:blog-7943969940790878616.post-21557488065408024142023-12-29T02:01:00.000+05:302023-12-29T02:01:01.755+05:30ToString method in Object class
In .Net, all the data types are derived from Object data type. Object data type has a method named ToString, which is overridable and provides a basic implementation of converting any object to String.
By default ToString returns the objects Class name along with its namespace.
Example:
namespace HelloWorld;
class Employee {
}
class Program
{
static void Main(string[] args)
&Develop Onhttp://www.blogger.com/profile/09383947133712300352noreply@blogger.com0tag:blogger.com,1999:blog-7943969940790878616.post-41293377327966149092023-12-20T00:04:00.002+05:302023-12-20T00:21:47.954+05:30Using CultureInfo for Localization As the computer programs are worldwide and the world has so many countries and languages and cultures, it is an
important topic to understand the .Net Capability to support it.
.Net has a class call CultureInfo available in System.Globalization namespace to use the most of the cultures available in the world.
We can use these cultures for various localization purpose such as Develop Onhttp://www.blogger.com/profile/09383947133712300352noreply@blogger.com0tag:blogger.com,1999:blog-7943969940790878616.post-77871302252098820692023-12-19T23:26:00.005+05:302023-12-20T00:22:05.796+05:30Primitive types in C# Following are primitive data types used in C#
Purpose
C# Data Type
.Net Data Type
Text
char
System.Char
string
System.String
Develop Onhttp://www.blogger.com/profile/09383947133712300352noreply@blogger.com0tag:blogger.com,1999:blog-7943969940790878616.post-88589534096230881572023-12-19T23:02:00.003+05:302023-12-20T00:22:37.308+05:30Declaring and initializing a variable
Develop On Post
In C#, you should declare a variable before using a variable.
You can declare variable using the following syntax.
Syntax:
{datatype} {variable-name};
Example:
int i;
Assigning a value while declaring is called Initialization.
Syntax:
{datatype} {variable-name} = {expession};
Example:
int i = 100;
Here the expression in the rightDevelop Onhttp://www.blogger.com/profile/09383947133712300352noreply@blogger.com0tag:blogger.com,1999:blog-7943969940790878616.post-57475121608846989002023-12-16T01:26:00.006+05:302023-12-30T12:24:03.671+05:30Floating Point Numeric Data types.Net supports three floating point numeric data type.
Below are all the floating point numeric data types supported by .net and their corresponding c# data types
You can choose one of these types for you variables and constants depending upon your requirement (range of the data and its precision).
Decimal (decimal) is high precision but with less range.
Single (float) and Double(double) are low Develop Onhttp://www.blogger.com/profile/09383947133712300352noreply@blogger.com0tag:blogger.com,1999:blog-7943969940790878616.post-72567583060632912462023-12-16T01:03:00.005+05:302023-12-16T01:22:40.053+05:30Fixed Point Numeric Data types.Net supports many fixed point numeric data type by default.
Mostly we use integers.
Below are all the fixed point numeric data types supported by .net and their corresponding c# data types
You can choose one of these types for you variables and constants depending upon your requirement (range of the data and it can be negative number of not).
.Net Type
C# Develop Onhttp://www.blogger.com/profile/09383947133712300352noreply@blogger.com0tag:blogger.com,1999:blog-7943969940790878616.post-43955436376909974952023-12-09T00:16:00.003+05:302023-12-09T00:16:27.247+05:30String to Number conversionIn many scenarios we need to convert our data from one data type to another.
Most important one is converting a text (string) to number (int, float etc).
We can not assign a string data type int (or any number data types) directly.
Let's take the below code as an example
string t = "28";
int age = t;
It will cause the below compilation error
Cannot implicitly convert type 'string' to 'int'
Develop Onhttp://www.blogger.com/profile/09383947133712300352noreply@blogger.com0tag:blogger.com,1999:blog-7943969940790878616.post-12458659183211045642023-12-08T20:14:00.002+05:302023-12-08T20:14:19.366+05:30VS Code- Recommended Extensions for C# Following extensions helps you work with C# in VSCode
C#
Id:
ms-dotnettools.csharp
Description
Base language support for C#
Publisher:
Microsoft
VS Marketplace Link:
https://Develop Onhttp://www.blogger.com/profile/09383947133712300352noreply@blogger.com0tag:blogger.com,1999:blog-7943969940790878616.post-10752433862167385202023-12-03T12:45:00.003+05:302023-12-03T20:57:40.097+05:30Useful dontet CLI commands for projectsTo list available project templates
dotnet new list
To create a solution
dotnet new sln --name HelloWorld
To create a project
dotnet new console --name HelloWorlddotnet new classlib --name HelloWorldLib
To create a project with Program class (Traditional)
dotnet new console --name HelloWorld --use-program-main true
New project commands will create projects without linking them to Develop Onhttp://www.blogger.com/profile/09383947133712300352noreply@blogger.com0tag:blogger.com,1999:blog-7943969940790878616.post-19967518200663604752023-12-02T23:41:00.000+05:302023-12-03T20:57:31.977+05:30Useful dotnet CLI commands Below are some of useful dotnet cli commandsList installed SDKs
dotnet --list-sdks
List Installed runtimes
dotnet --list-runtimes
Show Version
dotnet --version
List installed workloads
dotnet workload list
Search workloads available
dotnet workload search
Install a new workload
dotnet workload install <workloadid>
Note: workload id available in workload search
Remove all Develop Onhttp://www.blogger.com/profile/09383947133712300352noreply@blogger.com0tag:blogger.com,1999:blog-7943969940790878616.post-91490221140942009312020-07-26T09:55:00.002+05:302023-12-30T12:23:32.082+05:30Implicitly Typed Local Variables in C#Develop Onhttp://www.blogger.com/profile/09383947133712300352noreply@blogger.com0