Features of C# 14.0 🧩 1️⃣ Field-backed Properties (0:40 – 1:00) Pehla feature hai — Field-backed Properties Ab aapko manually private field likhne ki zarurat nahi. C# 14 mein ek naya contextual keyword aaya hai — field public string Name { get ; set => field = value ?? throw new ArgumentNullException( nameof ( value )); } Yahaan field compiler-generated backing field ko represent karta hai. Validation ya logic likhna ab super easy ho gaya hai! 🧩 2️⃣ Extension Members (1:00 – 1:25) Dusra feature — Extension Members Pehle hum sirf extension methods bana sakte the, ab hum properties , events , aur static members bhi extend kar sakte hain! public static class StringExtensions { public static int WordCount ( this string str) => str.Split( ' ' ).Length; } Ab koi bhi string par .WordCount() laga ke result le sakte ho — reusability aur readability dono badh gayi! 💪 🧩 3️⃣ Null-Conditional Assignment (1:25 – 1:50) ...
It is used to solve condition-based problems using if and else block-level statement. it provides a separate block for if statement, else statement, and elif statement . elif statement is similar to elseif statement of C, C++ and Java languages. Type of Conditional Statement:- 1) Simple if:- We can write a single if statement also in python, it will execute when the condition is true. for example, One real-world problem is here?? we want to display the salary of employees when the salary will be above 10000 otherwise not displayed. Syntax:- if(condition): statements The solution to the above problem sal = int(input("Enter salary")) if sal>10000: print("Salary is "+str(sal)) Q) WAP to increase the salary of employees from 500 if entered salary will be less than 10000 otherwise the same salaries will be displayed. Solution:- x = int(input("enter salary")) if x<10000: x=x+500 print(x) Q) WAP to display th...
sir please give me a hinting of this problem
ReplyDeletesir please five me hinting about this problem ?
ReplyDeleteTo solve these problem first you should learn array concept in depth, you can go on My java tutorial and read array articles, some program solution is here.
ReplyDeletehttps://www.shivatutorials.com/2019/10/array-concept-in-java_30.html