About HPC Systems Software User Guides Education Partners

  / gears / hpc / education / tutorials / java / example5


Introduction

Definition

Examples

Installation

Applets

Example 01

Example 02

Example 03

Example 04

Example 05

Example 06

Object Oriented Programming

Java Security

References

Example 5

  • Given: Example 4
  • Required: Take the square root of a negative number!
  • Solution: If (sum > 200)
    sum = sum*(-1);
    System.out.println(" sum is " + sum);
    srsum = Math.sqrt(sum);
    System.out.println(" square root of sum is " + srsum);


Please send questions or suggestions about this web page to beatnic@aset.psu.edu

ASET | ITS | Penn State