Tuesday, 17 September 2013

Simple coding test

Simple coding test

I need to create a simple coding test in Java but I don't know much java.
I don't know how exceptions work in Java. I don't need the answers, I just
want to translate this to Java as it is. Here is the C# version
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Test
{
class Program
{
static void Main(string[] args)
{
try
{
//reverse string
Testone("one two three four");
//Output the largest sum of 2 contiguous integers in this array
Testtwo(new int[5]{5,7,2,6,12});
//Anagrams?
Testthree("traditional","rtdatioialn");
catch (Exception e)
{
Console.WriteLine("{0} Exception was caught.", e);
}
Console.WriteLine("'q' to exit.");
while (Console.Read() != 113) {
}
}
private static void Testone(string One)
{
throw new NotImplementedException();
}
private static void Testtwo(int[] Two)
{
throw new NotImplementedException();
}
private static void Testthree(string Three, string Four)
{
throw new NotImplementedException();
}
}

No comments:

Post a Comment