Ad
Code
Diff
  • public class MyCalculator { 
        public static int add(int a, int b) {
                return a + b;
        }
    }
    • namespace Solution
    • {
    • public class MyCalculator
    • {
    • public int Add(int a, int b)
    • {
    • public class MyCalculator {
    • public static int add(int a, int b) {
    • return a + b;
    • }
    • }
    • }
Code
Diff
  • public class Program {
      public static String helloWorld(boolean world) {
        if (world) {
          return "Hello, World";
        }
      return "Goodbye, World";
      }
    }
    • def hello_world(world):
    • if world == True:
    • return "Hello, World"
    • return "Goodbye, World"
    • public class Program {
    • public static String helloWorld(boolean world) {
    • if (world) {
    • return "Hello, World";
    • }
    • return "Goodbye, World";
    • }
    • }
Code
Diff
  • public class Program {
      public static String digitToText(int digit) {
        final String[] nums = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
        return nums[digit];
      }
    }
    
    • const nums = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']
    • function digitToText(digit) {
    • return nums[digit]
    • }
    • public class Program {
    • public static String digitToText(int digit) {
    • final String[] nums = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
    • return nums[digit];
    • }
    • }