C
C#5mo ago
Jexs

can someone review my comments?

using System;

namespace ExampleNamespace
{
// Define a class named Example
class Example
{
// Define a method named DoSomething in the Example class
public void DoSomething()
{
Console.WriteLine("do something with this object");
}
}

// Define a class named ExampleUser
class ExampleUser
{
// Define a method named UseExample in the ExampleUser class
// This method takes an instance of the Example class as a parameter
public void UseExample(Example example)
{
// Call the DoSomething method on the Example instance passed as a parameter
example.DoSomething();
}
}

// Define the main entry point of the application
class Program
{
static void Main(string[] args)
{
// Create an instance of the Example class
Example exampleInstance = new Example();

// Create an instance of the ExampleUser class
ExampleUser user = new ExampleUser();

// Pass the instance of the Example class to the UseExample method
user.UseExample(exampleInstance);
}
}
}
using System;

namespace ExampleNamespace
{
// Define a class named Example
class Example
{
// Define a method named DoSomething in the Example class
public void DoSomething()
{
Console.WriteLine("do something with this object");
}
}

// Define a class named ExampleUser
class ExampleUser
{
// Define a method named UseExample in the ExampleUser class
// This method takes an instance of the Example class as a parameter
public void UseExample(Example example)
{
// Call the DoSomething method on the Example instance passed as a parameter
example.DoSomething();
}
}

// Define the main entry point of the application
class Program
{
static void Main(string[] args)
{
// Create an instance of the Example class
Example exampleInstance = new Example();

// Create an instance of the ExampleUser class
ExampleUser user = new ExampleUser();

// Pass the instance of the Example class to the UseExample method
user.UseExample(exampleInstance);
}
}
}
im worried about this code the most since it doesnt sound right to me
class ExampleUser
{
// Define a method named UseExample in the ExampleUser class
// This method takes an instance of the Example class as a parameter
public void UseExample(Example example)
{
// Call the DoSomething method on the Example instance passed as a parameter
example.DoSomething();
}
}
class ExampleUser
{
// Define a method named UseExample in the ExampleUser class
// This method takes an instance of the Example class as a parameter
public void UseExample(Example example)
{
// Call the DoSomething method on the Example instance passed as a parameter
example.DoSomething();
}
}
is
class Example
{
// Define a method named DoSomething in the Example class
public void DoSomething()
{
Console.WriteLine("do something with this object");
}
}
class Example
{
// Define a method named DoSomething in the Example class
public void DoSomething()
{
Console.WriteLine("do something with this object");
}
}
the instance of the example class if not what is the instance?
9 Replies
joy
joy5mo ago
What doesn't sound right? When you pass exampleInstance to useExample you're using the instance of the Example class.
Jexs
JexsOP5mo ago
so would you say theses comments are correct? @hour btw ty for your responce!
joy
joy5mo ago
Yeah they are correct in explaining what the code does
Jexs
JexsOP5mo ago
ty buddy thanks for your reassurance !
joy
joy5mo ago
You could use Documentation Comments to improve them
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
joy
joy5mo ago
I assumed this
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Angius
Angius5mo ago
What the comments say is correct However, the comments themselves are useless
Want results from more Discord servers?
Add your server