O'Reilly logo

Java Gently, Third Edition by Judith Bishop

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Types and methods

Types and methods

3.1 Talking about types

3.2 Repetition with for-loops

3.3 Making methods

3.4 Passing parameters and returning results

3.5 Typed methods

3.6 The type boolean

3.7 Case Study 1: Pizza Delivery 2U

Talking about types

Having examined integer numbers in Section 2.4, we now continue our discussion of types. Java has six numeric types – int, long, double, byte, short and float – which we shall consider first, and two special types, boolean and char, which we shall look at later. When considering the numeric types, we raise the issue of how to convert from one to the other, so that assignments can be made between variables of different ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required