Java Training Course/Example Programs

From tehowiki
Revision as of 08:20, 13 November 2017 by imported>Gfis
Jump to navigation Jump to search

Start with a greeting

  • HelloWorld - output only

Arguments, assignment, elementary String and arithmetic operations

  • StringAdd - concatenate argument strings 4 times and print them out
  • IntAdd - add 4 integers 4 times and print them
  • IntMultiply - multiply 4 integers 4 times and print the product
  • LongMultiply - multiply 4 long numbers

Loops (while, for) and conditions (if)

  • PowersOf2 - print the powers of 2
    • PowersOf2Check - check for increasing sequence
    • PowersOf2Backwards - print sequence backwards

Arrays

    • PowersOf2Array - print sequence from an array