Answers for "c# error CS0272"

C#
1

c# error CS0272

/* 
	Sedan.cs(10,7): error CS0272: The property or indexer 
    'Vehicle.LicensePlate' cannot be used in this context 
    because the set accessor is inaccessible 
    																*/
// Creating a superclass, neither private nor public works for setting
// PS it's too insecure
class Vehicle
  {
    public string LicensePlate
    { get; private set; }
  }								//creates error

class Vehicle
  {
    public string LicensePlate
    { get; protected set; }
  }								//fixes error
Posted by: Guest on March-05-2020

Code answers related to "c# error CS0272"

C# Answers by Framework

Browse Popular Code Answers by Language