how to call a method from a class in c#
C#
using System;
namespace CalculatorApplication {
class NumberManipulator {
public int FindMax(int num1, int num2) {
/* local variable declaration */
int result;
if (num1 > num2)
result = num1;
else
result = num2;
return result;
}
static void Main(string[] args) {
/* local variable definition */
int a = 100;
int b = 200;
int ret;
NumberManipulator n = new NumberManipulator();
//calling the FindMax method
ret = n.FindMax(a, b);
Console.WriteLine("Max value is : {0}", ret );
Console.ReadLine();
}
}
}
Also in C#:
- Title
- c# resize image keep aspect ratio
- Category
- C#
- Title
- cshtml foreach
- Category
- C#
- Title
- c# enum to int array
- Category
- C#
- Title
- c# AllowSynchronousIO to true
- Category
- C#
- Title
- how to remove space between string in c#
- Category
- C#
- Title
- what is a return statement C#
- Category
- C#
- Title
- set label position winforms
- Category
- C#
- Title
- c# print to console
- Category
- C#
- Title
- windows form rounded corners
- Category
- C#
- Title
- c# expression func automatically select return type
- Category
- C#
- Title
- C# loop through array of objet
- Category
- C#
- Title
- list.addrange in c#
- Category
- C#
- Title
- c# windows application get current path
- Category
- C#
- Title
- how to make a game
- Category
- C#
- Title
- linq c# or
- Category
- C#
- Title
- json tiers dot in name c#
- Category
- C#
- Title
- c# remove last character from string
- Category
- C#
- Title
- asp.net core redirecttoaction with parameters
- Category
- C#
- Title
- max of array C#
- Category
- C#
- Title
- C# save pdf stream to file
- Category
- C#
- Title
- jumping with character controller unity
- Category
- C#
- Title
- change sprite of gameobject unity
- Category
- C#
- Title
- select a whole row out of a 2d array C#
- Category
- C#
- Title
- c# push numbers to array
- Category
- C#
- Title
- c# download file
- Category
- C#
- Title
- unity set object scale
- Category
- C#
- Title
- c# access session in class
- Category
- C#
- Title
- unity how to check object position
- Category
- C#
- Title
- json stringify c#
- Category
- C#
- Title
- how to declare variables in c#
- Category
- C#
- Title
- set int to null c#
- Category
- C#
- Title
- check for collision unity c#
- Category
- C#
- Title
- flip boolean c#
- Category
- C#
- Title
- How to execute script in C#
- Category
- C#
- Title
- convert from xls to xlsx C#
- Category
- C#
- Title
- add spaces between words unity
- Category
- C#
- Title
- c# how to initialize an array
- Category
- C#
- Title
- c# switct case
- Category
- C#
- Title
- center an image horizontally and vertically
- Category
- C#
- Title
- native-googlesignin configuration is null!?
- Category
- C#
- Title
- transform object according to its parent unity
- Category
- C#
- Title
- get type of variable c#
- Category
- C#
- Title
- c# get all class properties
- Category
- C#
- Title
- c# if statement
- Category
- C#
- Title
- unity onselect gizmos wireframe
- Category
- C#
- Title
- unity move character
- Category
- C#
- Title
- c# summary tag
- Category
- C#
- Title
- how get data from json in c#
- Category
- C#
- Title
- install .net sdk ubuntu 20
- Category
- C#
- Title
- unity find object by name
- Category
- C#
- Title
- unity accessing 2d pointlight from c# script
- Category
- C#
- Title
- unity variable from another script
- Category
- C#
- Title
- south african id number validation c#
- Category
- C#
- Title
- unity timer with miliseconds
- Category
- C#
- Title
- dynamic convert type c#
- Category
- C#
- Title
- how to store some variables on the device in unity
- Category
- C#
- Title
- c# making a folder
- Category
- C#
- Title
- c# get index of item in list
- Category
- C#
- Title
- c# keyboard enter
- Category
- C#
- Title
- convert string to double c#
- Category
- C#
- Title
- c# get country code
- Category
- C#
- Title
- c# change variable types
- Category
- C#
- Title
- initialize enum with another enum c#
- Category
- C#
- Title
- c# instantiate
- Category
- C#
- Title
- appsettings in console application c#
- Category
- C#
- Title
- unity c# change color of gameobject
- Category
- C#
- Title
- isprime c#
- Category
- C#
- Title
- how to trigger event when a com device is connected in c#
- Category
- C#
- Title
- go right unity
- Category
- C#
- Title
- c# dictionary literal initializer
- Category
- C#
- Title
- c# get pc ip address
- Category
- C#
- Title
- c# regex to find number between parenthesis
- Category
- C#
- Title
- visual studio c# mark class deprecated
- Category
- C#
- Title
- never lose focus textbox c#
- Category
- C#
- Title
- how to convert string to bool c#
- Category
- C#
- Title
- how to route back to url using Request.Headers["Referer"].ToString() in asp.net core
- Category
- C#
- Title
- c# convert Unix time in seconds to datetime
- Category
- C#
- Title
- escape double quotes c#
- Category
- C#
- Title
- Failed to retrieve Firebase Instance Id
- Category
- C#
- Title
- c# check file exists
- Category
- C#
- Title
- letter at index of string c#
- Category
- C#
- Title
- c# iorderedenumerable to dictionary
- Category
- C#
- Title
- c# append array
- Category
- C#
- Title
- check if current time is in the morning c#
- Category
- C#
- Title
- c# singleton
- Category
- C#
- Title
- c sharp comments
- Category
- C#
- Title
- c# linq join multiple conditions
- Category
- C#
- Title
- mongodb c# batch find
- Category
- C#
- Title
- get string character by index c#
- Category
- C#
- Title
- c# duplicate object instance
- Category
- C#
- Title
- c# scene manager
- Category
- C#
- Title
- unity check if gameobject is active
- Category
- C#
- Title
- c# global enumerator
- Category
- C#
- Title
- countdown script unity
- Category
- C#
- Title
- example HttpClient c# Post
- Category
- C#
- Title
- winforms c# add data to datagridview with a button
- Category
- C#
- Title
- C# sprint key
- Category
- C#
- Title
- how to reference a child object unity
- Category
- C#
- Title
- making a list of chars in c#
- Category
- C#
- Title
- loop gridcontrol devexpress c#
- Category
- C#