Monday, June 21

Quick Revision 2

                          Boolean.




                     Comparison operators.

                                Math library.

                                for more details

          Command-line arguments.

int    a = Integer.parseInt(args[0]);   // read int    from command-line
double b = Double.parseDouble(args[1]); // read double from command-line
String c = args[2];                     // read String from command-line

         Type conversion.

         

                  If and if-else statements.

              The String data type.

                          for more details

String s = "Hello";
String t = "World";
String u = s + " " + t;     // "Hello World"
int length = s.length();    // 5    (length of string)
char c = t.charAt(2);       // 'r'  (character indices start at 0)
s.equals("Hello");          // compare string for equality

             Our standard output

        

                       

      rest in next (post)...

No comments:

Post a Comment