© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
40 replies
Dan

Object Method error

True is only outputted with referenceclass2 not with referenceclass1. I can probably avoid with exception handling but this is for practice. Any ideas why the error
Class1 referenceclass1 = new Class1(word);
referenceclass1.word = "area";
referenceclass1.sentence = "area is a word";
referenceclass1.letters = 12;
Class1 referenceclass2 = new Class1("apple", "apple is a fruit", 13);

Console.WriteLine(referenceclass1.IsWord());
Console.WriteLine(referenceclass2.IsWord());
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

method with object lists error
C#CC# / help
2y ago
Which object creation method is more used?
C#CC# / help
2y ago
✅ Accsessing Method in another class by object
C#CC# / help
4y ago
❔ ✅ method array arg error
C#CC# / help
4y ago