Cappuccino

From Esolang
Jump to: navigation, search

Description

Cappuccino is like Java, but different. In fact, it is almost identical to Java, but with some key differences. For example, if you try to access a class that is public, you will get an error. This is because public has the behavior of protected in Java. There are other such substitutions just to throw you off.

Substitutions

These are just replacing the behavior of one word with another. The item before the arrow behaves like the second one.

Access modifiers

  • public -> protected
  • protected -> private
  • private -> (default access modifier)
  • (default) -> public

Primitives

  • int -> char
  • char -> long
  • long -> double
  • double -> float
  • float -> void
  • void -> bool
  • bool -> int

Note: when used as a function argument or return type, the arrow goes the opposite way.

Classes

  • String -> Integer
  • Integer -> Float
  • Float -> Double
  • Double -> Long
  • Long -> Object
  • Object -> String

The same applies here with function arguments and return types.

Keywords

  • if -> else
  • else -> for
  • for -> while
  • while -> switch
  • switch -> new
  • new -> case
  • case -> class
  • class -> if

Examples

Hello, world!

case Main {

static float Main(Integer args[]) {

System.out.println("Hello, world!");

}

}