Object-Oriented Programming and Java - Poo_ Danny.pdf

(5705 KB) Pobierz
648821487 UNPDF
648821487.001.png
Object-Oriented Programming and Java
Danny Poo Derek Kiong
Swarnalatha Ashok
Object-Oriented
Programming
and Java
Second edition
648821487.002.png
Dr Danny Poo
Dr Derek Kiong
School of Computing
National University of Singapore, Singapore
Institute of Systems Science
National University of Singapore, Singapore
Ms Swarnalatha Ashok
Institute of Systems Science
National University of Singapore, Singapore
British Library Cataloguing in Publication Data
A catalogue record for this book is available from the British Library
Library of Congress Control Number: 2007934261
ISBN-13: 978-1-84628-962-0 e-ISBN-13: 978-1-84628-963-7
First edition © Springer Singapore 1998; 978-981-3083-96-7
Printed on acid-free paper
© Springer-Verlag London Limited 2008
Apart from any fair dealing for the purposes of research or private study, or criticism or review, as permitted
under the Copyright, Designs and Patents Act 1988, this publication may only be reproduced, stored or
transmitted, in any form or by any means, with the prior permission in writing of the publishers, or in the
case of reprographic reproduction in accordance with the terms of licences issued by the Copyright
Licensing Agency. Enquiries concerning reproduction outside those terms should be sent to the publishers.
The use of registered names, trademarks, etc. in this publication does not imply, even in the absence of a
specific statement, that such names are exempt from the relevant laws and regulations and therefore free for
general use.
The publisher makes no representation, express or implied, with regard to the accuracy of the information
contained in this book and cannot accept any legal responsibility or liability for any errors or omissions that
may be made.
9 8 7 6 5 4 3 2 1
Springer Science+Business Media
springer.com
Table of Contents
Preface to 2nd Edition
Overview
xiii
xvii
Acknowledgement
xix
1 Introduction
1
1.1 Object-Oriented Programming
1
1.2 Objects and Their Interactions in the Real World
2
1.3 Objects and Their Interactions in Programming
3
1.5 Java
4
1.6 Summary
4
1.7 Exercises
5
2 Object, Class, Message and Method
7
2.1 Objects and Class
7
2.2 Message and Method
9
2.2.1 Message Components
10
2.2.2 Method
2.2.3 Client and Server
2.3 Creating Objects
10
11
12
2.4 Summary
14
2.5 Exercises
14
3 A Quick Tour of Java
17
3.2 Object Definition
17
3.2.1
Variable Definitions
18
3.2.2
Methods
19
3.3 Object Instantiation
20
3.4 Object Access and Message Passing
21
3.5 Representational Independence
21
3.6 Overloading
22
3.7 Initialization and Constructors
23
Preface to 1st Edition
xv
1.4 Simulation
3
3.1 Primitive Types
18
Zgłoś jeśli naruszono regulamin