Essential Java for Scientists and Engineers
Essential Java
for
Scientists and Engineers
Brian D. Hahn
Department of Mathematics & Applied Mathematics
University of Cape Town
Rondebosch
South Africa
Katherine M. Malan
Department of Computer Science
University of Cape Town
Rondebosch
South Africa
OXFORD AMSTERDAM BOSTON LONDON NEW YORK PARIS
SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO
Butterworth-Heinemann
An imprint of Elsevier Science
Linacre House, Jordan Hill, Oxford OX2 8DP
225 Wildwood Avenue, Woburn, MA 01801-2041
First published 2002
Copyright c© 2002 Brian D. Hahn and Katherine M. Malan. All rights reserved
The right of Brian D. Hahn and Katherine M. Malan to be identified
as the authors of this work has been asserted in accordance with
the Copyright, Designs and Patents Act 1988
All rights reserved. No part of this publication
may be reproduced in any material form (including
photocopying or storing in any medium by electronic
means and whether or not transiently or incidentally
to some other use of this publication) without the
written permission of the copyright holder except
in accordance with the provisions of the Copyright,
Designs and Patents Act 1988 or under the terms of a
licence issued by the Copyright Licensing Agency Ltd,
90 Tottenham Court Road, London, England W1T 4LP.
Applications for the copyright holder’s written permission
to reproduce any part of this publication should be addressed
to the publishers
British Library Cataloguing in Publication Data
A catalogue record for this book is available from the British Library
Library of Congress Cataloguing in Publication Data
A catalogue record for this book is available from the Library of Congress
ISBN 0 7506 5422 8
For information on all Butterworth-Heinemann publications visit our website at www.bh.com
Typeset by Laserwords Private Limited, Chennai, India.
Printed and bound in Martins the Printers of Berwick Upon Tweed
Contents
Preface
xiii
Acknowledgements
xvi
Part I Essentials
1
1 Getting going
3
1.1
Introduction to programming
3
Java