Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7532497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:28:17+00:00 2026-05-30T05:28:17+00:00

I am new to C# and I am working on classes. What is the

  • 0

I am new to C# and I am working on classes. What is the best way to learn classes so that a person can understand it.

I do understand to get a class you go up to the bar and click on add new item and then selected class. You can name that class such as AddValue.cs so that way that is what your class is being called.

I am trying to understand this I am working with number like a calculator.
I made my class and it is called CalculateValue.cs. In this I need need to create 2 private variables, _num1 and _num2.

Which I wrote
int _num1;
int _num2;
I wrote that under the class name. But my whole problem is I don’t really know how to code for the class. I am trying to understand it but its not working. What are some ways that help you understand how to code using classes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:28:19+00:00Added an answer on May 30, 2026 at 5:28 am

    It’s not the kind of question SO like you asking here to be honest taylor. And to be fair – a book probably is your best solution anyway. There must be hundreds of books out there (many free) that will acquaint you with principles of OOP. I’ll have a look for a link to a few in a minute if I get a chance.

    As a sort of attempt to answer your question – I feel like you’ve got two main issues here – you’re not exactly familiar with OOP principles, and you’re stuck on how to use the IDE (visual studio). In which case, I’d advise you buy a book which deals with teaching OOP principles for a particular language so that the use of the IDE is also covered. As you’ve mentioned C#, go for that one. C# for dummies or something?

    Think of OOP almost as an approach to programming. It’s, amongst many other things, a way of implementing encapsulation. It’s important for us to be organised when developing, very organised, and encapsulation is a way of you also organising your code. I don’t mean just for organisation purposes (i.e. to keep it all clean and tidy), but to tackle many other issues aswell.

    What you’ve just done there (with your two int variables), is created two private properties of your class. Think of those almost as attributes to your class, just as height is to person, it’s a property. Another type of member can be a method. A method DOES something. Say, for example, you wanted to add those two numbers together, you may have your two variables and a 3rd member (a method) called Add(). This class you’re talking about then is capable of storing two numbers, and capable of performing something you’ve called Add() (it may be to add the two numbers). I could go on about the basics of then creating and instance of your class and using it but I’d be here all day. And besides – there’s a lot more to take into consideration. For example, you’ve created PRIVATE variables, these won’t be accessible outside of the class, and depending on what you want to do with them (i.e. how/where you would like to access them) they may need some sort of public access modifier. There’s loads to learn mate, get reading. It’s worth it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm way new to working with XML but just had a need dropped in
I'm working with xcode and I have classes associated with other projects that I
I have a class that creates Custom Selectboxes. its working fine and I want
I'm working on developing new Spring web applications, on a team that's developed a
Working on developing a Class for my android app that will randomly generate NPCs
New to java, but would love to implement my working jsp that generates xml
I have a repository class that defines some basic Get/Save/Delete methods. Inside these, I
I'ver been wondering how to best implement equals() for a family of classes that
I am new at Django and I have tried my best to understand it
What I'm looking for is some sort of class or annotation I can add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.