// LiteralTests.java Copyright (c) 2005 Kari Laitinen // http://www.naturalprogramming.com // 2005-07-14 File created. // 2005-07-14 Last modification. import java.util.* ; class LiteralTests { public static void main( String[] not_in_use ) { char some_character = 'X' ; System.out.print( "\n " + some_character ) ; char another_character = '\u0041' ; System.out.print( " " + another_character ) ; char third_character = 0x33; // '\x33' does not work in Java System.out.print( " " + third_character ) ; System.out.print( " " + '\\' + " " + '\'' + " " + '\0' + " " + '\0' + " " + '\"' + " " + '\t' + " " + 'z' ) ; System.out.print( '\u0007' ) ; // '\a' alert does not exist in Java System.out.print( "\nxxxx" + '\t' + "xxxx" + '\t' + "xxxx" ) ; byte some_byte = 123 ; byte another_byte = (byte) 'A' ; int some_integer = 'A' ; // this is allowed System.out.print( "\n " + some_byte + " " + another_byte + " " + some_integer ) ; some_integer = 123 ; short some_short_integer = 123 ; long some_long_integer = 123 ; float some_float = 34.45e-3F ; //float some_float = 34.45e-3f ; // this works as well double some_double = 34.45e-3 ; System.out.print( "\n float " + some_float + " double " + some_double ) ; some_float = 2.998e8F ; some_double = 2.998e8 ; System.out.print( "\n float " + some_float + " double " + some_double ) ; System.out.print( "\n This line will be written over by the next line"); System.out.print( "\r " ) ; System.out.print( "\n The full stop of this sentence is deleted." ) ; System.out.print( "\b " ) ; // deleting the full stop } }