How to handle exception, for "up to 10" limit, for integer (method parameter)
Hello!
Recently I had an interview, where I was asked to handle up to 10 numberOfmyTEST.
I wrote the following approach, which was not the accepted one.
Could you please help me to understand how Could I handle this exception?
thank you!
Hello!
Recently I had an interview, where I was asked to handle up to 10 numberOfmyTEST.
I wrote the following approach, which was not the accepted one.
Could you please help me to understand how Could I handle this exception?
thank you!
C#:
using System;
using System.Collections.Generic;
public class myTEST
{
public static int myMethod(int numberOfmyTEST)
{
if (numberOfmyTEST>10)
{
throw new NotImplementedException ("Up to 10 story buildings");
}
else
{
// do something
}
}
public static void Main(String[] args)
{
Console.WriteLine(myMethod(3));
}
}