C Sharp (C#) - Classes and Objects
Identify the error in this class declaration:
class Book
{
string title;
void SetTitle(string t)
{
title = t;
}
}class Book
{
string title;
void SetTitle(string t)
{
title = t;
}
}title and method SetTitle lack access modifiers like private or public, which can cause confusion or errors in some contexts.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions