Setting a value to 'private' declared property, here in example its 'IntrestRate' from different class is not possible. But value can still be set from other class by following below context public Accounts(float amt, float intr) { InitialAmount = amt; IntrestRate = intr; } class Program { static void Main(string[] args) { Accounts a1 = new Accounts(5000,9.9f); } having a constructor which can pass the value for private property from other class is still possible
To Get Certification, Click Here: bitly.ws/P9Up
Use coupon "UA-cam12" to get ‘’FLAT 12%’’ OFF at Checkout.
Setting a value to 'private' declared property, here in example its 'IntrestRate' from different class is not possible. But value can still be set from other class by following below context
public Accounts(float amt, float intr)
{
InitialAmount = amt;
IntrestRate = intr;
}
class Program
{
static void Main(string[] args)
{
Accounts a1 = new Accounts(5000,9.9f);
}
having a constructor which can pass the value for private property from other class is still possible
Thank you sir for making on C#
Great
2nd..