Home : Course Map : Chapter 2 : Tech :
Exercises
JavaTech
Course Map
Chapter 2

Introduction
Essentials
Structure

Keywords
Primitive Types
Comments
Literals
Expressions
Operators
Statements
Casts & Mixing
Strings
Console Output 
   Demo
Exercises

    Supplements
Conditional: if-else
Repetitions
Flow Control

Java vs C/C++
JVM Instructions 1

     About JavaTech
     Codes List
     Exercises
     Feedback
     References
     Resources
     Tips
     Topic Index
     Course Guide
     What's New

 

  1. Investigate what happens when you cast a floating point (FP) value to an integer type when the FP value is larger than the largest value for that integer type. Examine also the case where a FP value that is lower (that is, more negative) than the minimum possible value for an integer value is cast to that integer type.

    For example, assign a value to a float variable that is larger than the largest possible int value. Then cast this float value to an int value. Print out the results. Do this for various combinations of the FP and integer types and repeat for the minimum value cases.

 

Latest update: Dec.11.2003

 

            Tech
Arithmetic Ops
Math Class
More on Integers
FP : Overview
FP : Java  
  
Demo 1
More Mix/Cast
  Demo 2
Exercises

           Physics
Differential Eq.
Euler Method
  
Demo 1
Predictor-Corrector
  
Demo 2
Exercises

  Part I Part II Part III
Java Core 1  2  3  4  5  6  7  8  9  10  11  12 13 14 15 16 17
18 19 20
21
22 23 24
Supplements

1  2  3  4  5  6  7  8  9  10  11  12

Tech 1  2  3  4  5  6  7  8  9  10  11  12
Physics 1  2  3  4  5  6  7  8  9  10  11  12

Java is a trademark of Sun Microsystems, Inc.