In this example, a class named Calculator is created that contains a method to add two numbers:
using System;
namespace Kuika.ThirdPartyApisCollection
{
public class Calculator
{
public static int Add(int a, int b)
{
return a + b;
}
}
}
using System: Adds the System library, which is required to use basic system functions in C#.
namespace Kuika.ThirdPartyApisCollection: This is the namespace where the C# functions in Kuika are located. It is included by default in templates; it should not be changed.
Calculator class: Created to perform mathematical operations.
Add method: The statement `public static int Add(int a, int b)` takes two integer (int) parameters. The statement `return a + b;` returns the sum of these two values. The method is defined as `public static`, just like in Kuika templates.
This example demonstrates the process of creating a class, defining a method, and performing a simple calculation in the C# language.