█ _ 0 حصريا كتاب An Introduction to Object Oriented Programming with Java TM 2024 TM: Published by McGraw Hill, a business unit of The Hill Companies, Inc , 1221 Avenue the v Preface xi 0 Introduction Computers and Programming Languages 1 0 1 A History Computers 2 0 2 Computer Architecture 4 0 3 Programming Languages 11 0 4 Java 12 1 Introduction and Software Development 15 1 1 Classes Objects 16 1 2 Messages Methods 18 1 3 Class Instance Data Values 20 1 4 Inheritance 23 1 5 Software Engineering Software Life Cycle 24 2 Getting Started Java 29 2 1 The First Program 30 2 2 Program Components 39 2 3 Edit Compile Run Cycle 49 2 4 Sample Standard Classes 52 2 5 Sample Development 69 Contents wu23305_fm qxd 2 17 09 10:38 AM Page v 3 Numerical Data 85 3 1 Variables 86 3 2 Arithmetic Expressions 94 3 3 Constants 99 3 4 Displaying Numerical Values 101 3 5 Getting Input 107 3 6 The Math Class 113 3 7 Random Number Generation 117 3 8 The GregorianCalendar Class 120 3 9 Sample Development 125 3 10 Numerical Representation ( Optional ) 136 4 Defining Your Own Classes—Part 1 151 4 1 First Example: Defining Using Class 152 4 2 Second Multiple Classes 162 4 3 Matching Arguments Parameters 166 4 4 Passing Objects Method 168 4 5 Constructors 173 4 6 Information Hiding Visibility Modifiers 180 4 7 Class Constants 183 4 8 Local Variables 191 4 9 Calling Methods the Same Class 193 4 10 Changing Any Class Main Class 197 4 11 Sample Development 198 5 Selection Statements 221 5 if Statement 222 5 2 Nested if Statements 233 5 3 Boolean Expressions Variables 239 5 4 Comparing Objects 247 5 5 The switch Statement 252 5 6 Drawing Graphics 256 5 7 Enumerated Constants 266 5 8 Sample Development 272 vi Contents wu23305_fm vi Contents vii 6 Repetition Statements 303 6 while Statement 304 6 2 Pitfalls in Writing Repetition Statements 313 6 3 The do–while Statement 319 6 4 Loop Half Control 323 6 for Statement 327 6 6 Nested for Statements 332 6 7 Formatting Output 334 6 8 Loan Tables 339 6 9 Estimating Execution Time 342 6 10 Recursive ( Optional ) 346 6 Development 351 7 Defining 2 373 7 1 Returning an from Method 374 7 2 The Reserved Word this 378 7 3 Overloaded Constructors 386 7 4 Class Variables Methods 391 7 5 Call Value Parameter Passing 395 7 6 Organizing Classes into Package 402 7 7 Using Javadoc Comments for Class Documentation 403 7 Complete Fraction Class 408 7 Development 418 8 Exceptions Assertions 445 8 1 Catching Exceptions 446 8 2 Throwing Exceptions Multiple catch Blocks 453 8 3 Propagating Exceptions 458 8 4 Types Exceptions 466 8 5 Programmer Defined Exceptions 469 8 6 Assertions 471 8 7 Sample Development 477 wu23305_fm vii viii Contents 9 Characters Strings 495 9 1 Characters 496 9 2 Strings 499 9 3 Pattern Matching Regular Expression 510 9 4 The Pattern and Matcher Classes 517 9 5 Comparing Strings 521 9 6 StringBuffer and StringBuilder 523 9 7 String Processing Bioinformatics 529 9 Development 533 10 Arrays Collections 555 10 1 Array Basics 556 10 2 Arrays Objects 567 10 For Each Loop 577 10 Arrays Methods 582 10 5 Two Dimensional Arrays 589 10 6 Lists Maps 596 10 Development 609 11 Sorting Searching 633 11 1 Searching 634 11 2 Sorting 638 11 3 Heapsort 646 11 Development 659 12 File Input Output 685 12 1 File and JFileChooser Objects 686 12 2 Low Level File I O 695 12 3 High O 700 wu23305_fm viii Contents ix 12 4 Object O 709 12 Development 716 13 Inheritance Polymorphism 733 13 Simple Example 734 13 2 Defining Inheritance 737 13 3 Using Effectively Polymorphism 741 13 4 Inheritance Member Accessibility 744 13 5 Inheritance Constructors 749 13 6 Abstract Superclasses Abstract Methods 753 13 7 Inheritance versus Interface 758 13 Development 759 14 GUI Event Driven Programming 787 14 1 Simple GUI O JOptionPane 790 14 2 Customizing Frame Windows 793 14 3 GUI Basics 799 14 4 Text Related Components 808 14 5 Layout Managers 820 14 6 Effective Use Nested Panels 830 14 7 Other Components 839 14 8 Menus 857 14 9 Handling Mouse Events 861 15 Recursive Algorithms 881 15 1 Basic Elements Recursion 882 15 2 Directory Listing 883 15 3 Anagram 885 15 4 Towers Hanoi 888 15 5 Quicksort 890 15 6 When Not Recursion 895 wu23305_fm ix x Contents Appendix A How Programs 903 Appendix B Sample Programs 911 Appendix C Standard Interfaces 933 Appendix D UML Diagrams 955 Index 963 كتب جافا مجاناً PDF اونلاين هي لغة برمجة كائنية التوجه ابتكرها جيمس غوسلينغ عام 1992م أثناء عمله مختبرات شركة صن ميكروسيستمز وذلك لاستخدامها بمثابة العقل المفكر المستخدم لتشغيل أجهزة التطبيقات الذكية مثل التليفزيون التفاعلي وقد كانت الجافا تطويرًا للغة سي ++ وعند ولادتها أطلق عليها مبتكرها "أواك" بمعنى شجرة السنديان؛ وهي الشجرة التي كان يراها من نافذة مكتبه وهو يعمل ثم تغير الاسم إلى وهذا (على غير العادة تسمية لغات البرمجة) ليس الحروف الأولى كلمات جملة معينة أو تعبيرًا معين ولكنه مجرد اسم وضعه مطورو هذه اللغة لينافس الأسماء الأخرى