CIS304 Week1 - CIS 304 Introduction / Review CIS 304...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS 304 Introduction / Review IS 304 Intermediate Java CIS 304 Intermediate Java Programming For Business
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Java Review from CIS 234 ± Primitives orking with Data ± Working with Data ± Conditional Statements ± Objects ± Loops ± Debugging
Background image of page 2
8 Primitive Data Types Type Size oolean 1 bit boolean char 16 bits or 2 bytes byte 8 bit or 1 byte short 16 bit or 2 bytes int 32 bit or 4 bytes long 64 bit or 8 bytes float 32 bit or 4 bytes double 64 bit or 8 bytes
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Implicit / Explicit Casting ± Implicit casting occurs when casting from less precise to more precise data types. This is called a widening conversion and is done automatically by java. yte ort t ng oat ouble Byte Î short Î int Î long Î float Î double ± To assign a more precise type to a less precise type you must specify the cast conversion. This is called a narrowing conversion because some ata can be lost. data can be lost. int average = (int) 33.2; //average will hold 33
Background image of page 4
Wrapper Classes ± Java provides built-in wrapper classes for Byte, Short, Boolean, Character, Integer, Double, Float, and Long. ± These wrapper classes provide some very handy tility methods. utility methods. ± Static methods available in wrapper classes ± Integer i = Integer.ParseInt(“20”); ± Double d = Double.ParseDouble(“20”); ± Create objects based on primitive types teger = new Integer(“1”); ± Integer i new Integer( 1 ); ± Double d = new Double("3.9");
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Variables and Constants Variables ± Java variables fall into two broad type categories ± primitive variable types ± reference variable types ± Primitive variables are created to hold primitive data types ± Store a copy of the primitive data type eference variables are used to refer to objects ± Reference variables are used to refer to objects.
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 16

CIS304 Week1 - CIS 304 Introduction / Review CIS 304...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online