Posts

Showing posts from January, 2024

BestWebsitesToLearn

  1. javaTpoint 2. tutorialsteacher 3. geeksforgeeks 4. c-sharpcorner 5. w3schools 6. tutorialspoint 7. Programiz 8. scholarhat 9. knowledgehut 10. java2s

DataTypes

1.Integral Types: byte: 8-bit unsigned integer. sbyte: 8-bit signed integer. short: 16-bit signed integer. ushort: 16-bit unsigned integer. int: 32-bit signed integer. uint: 32-bit unsigned integer. long: 64-bit signed integer. ulong: 64-bit unsigned integer. 2.Floating-Point Types: float: 32-bit single-precision floating-point number. double: 64-bit double-precision floating-point number. 3.Decimal Type: decimal: 128-bit decimal floating-point number with higher precision for financial and monetary calculations. 4.Character Types: char: 16-bit Unicode character. 5.Boolean Type: bool: Represents a Boolean value, which can be either true or false. 6.String Type: string: Represents a sequence of characters. It's used to store text. 7.Enum Type: enum: Represents a set of named integer constants. It's a user-defined type. 8.Nullable Value Types: Adding ? after a value type allows it to be assigned a value or null. For example, int? nullableInt = null; Arrays: You can create arrays ...

Conversions in C#

                 1.Implicit =>Small to Big => InBuilt Automatically will Do Ex: int numInt = 10; long numLong = numInt; // Implicit conversion from int to long 2.Explicit (Casting) =>Big to Small Ex: double numDouble = 3.14159; int numInt = (int)numDouble; // Explicit conversion from double to int (data loss) 3.Convert Class: =>The Convert class in C# provides methods for converting between different base data types, such as numbers and strings. string strNum = "123"; int num = Convert.ToInt32(strNum); // String to int conversion 4.Parsing:  =>For converting from strings to other data types, you can use the Parse methods provided by various data types (like int.Parse, double.Parse, etc.). Ex: string strDouble = "3.14"; double numDouble = double.Parse(strDouble); // String to double conversion 5.TryParse: => To handle potential parsing errors without throwing exceptions, you can use the TryParse methods, which return a b...

C# Topics

 1.DataTypes 2.Variables 3.Operators 4.Control Statements Loops 5.Classes 6.Methods/Functions 7.Constructors & Destructors 8.Delegates 9.Arrays & lists One Dimensional Array Multidimensional Array 10.Strings 11.Collections 12.Generics 13.Exception Handling 14.File Handling 15.Indexers 16.Interfaces 17.Fields and Properties 18.AccessModifiers 19.Static 20.This OOPS 1.Inheritance 2.Abstraction 3.Polymorphism 4.Encapsulation 5.Class 6.Object