一切都是对象 :
Alan kay曾经总结了第一个成功的面向对象语言、同时也是Java所基于的语言之一的Smalltalk的五个基本特性,这种特性表现了一种纯粹的面向对象程序设计方式:
1.万物皆为对象。
2.程序是对象的集合,他们通过发送消息来告知彼此所要做的。
3.每个对象都有自己的由其他对象所构成的存储。
4.每个对象都拥有其类型
5.某一特定类型的所有对象都可以接受同样的消息。
存储:
对象的存储方式:
1.寄存器
2.堆栈。位于通用RAM(随机访问存储器中)。
3.堆。new将对象存储在“堆”里。
4.常量存储
5.非RAM存储
static关键词
通过static关键字可以满足这两方面的需要。当生命一个事物是static时,就意味着这个域或方法不会与包含它的那个类的任何对象实例关联在一起。所以,即使从未创建某个类的任何对象,也可以调用其static方法或访问其static域。通常,你必须创建一个对象,并用它来访问数据或方法。因为非static域或方法必须知道他们一起运作的特定对象。
foreach语法
Java SE5引入了一种新的更加简洁的for语法用于数组或容器。
请注意,由于构造器的名称必须与类名完全相同。
Iterator迭代器
1.使用方法iterator()要求容器返回一个Iterator。
2.使用next()获得序列中的下一个元素
3.使用hasNext()检查序列中是否还有元素
4.使用remove()将迭代器新返回的元素删除
Next:正则表达式、容器、IO、并发等!
分享到:
相关推荐
5.4 OBJECT-ORIENTED SOFTWARE CONSTRUCTION 116 5.5 ISSUES 117 5.6 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 119 5.7 BIBLIOGRAPHICAL NOTES 119 Chapter 6: Abstract data types 121 6.1 CRITERIA 122 6.2 ...
Learn the basics of Java 9, including basic programming concepts and the object-oriented fundamentals necessary at all levels of Java development. Author Kishori Sharan walks you through writing your ...
Programmers who are unfamiliar with object-oriented programming notions should read the quick tour, while programmers who are already familiar with object-oriented programming paradigms will find the...
java 核心技术 第八版 core 卷1 Core Java, 8th Edition Core Java. Volume I. Fundamentals, 8th Edition Core Java. Volume II. Advanced Features, 8th Edition 官方网站 http://horstmann.com/corejava.html ...
Data Structures and Algorithms with Object-Oriented Design Patterns in Java - Bruno R. Preiss Data Structures and Algorithms with Object-Oriented Design Patterns in Python - Bruno R. Preiss Data ...
You’ll enjoy the treatment of object-oriented programming and an object-oriented design/UML® ATM case study, including a complete C# implementation. When you’ve mastered the book, you’ll be ready...
You’ll enjoy the Deitels’ classic treatment of object-oriented programming and the object-oriented design ATM case study, including a complete Java implementation. When you’re finished, you’ll ...
The C# project started almost ten years ago, in December 1998, with the goal of creating a simple, modern, object-oriented, and type-safe programming language for the new and yet-to-be-named .NET ...
C# supports object-oriented programming, and this chapter describes the language features dedicated to these techniques. Chapter 4, Extensibility and Polymorphism This chapter continues the discussion...
1.Introduction 2.Algorithm Analysis 3.Asymptotic Notation 4.Foundational Data Structures ...17.Python and Object-Oriented Programming 18.Class Hierarchy Diagrams 19.Character Codes 20.References
A text that really teaches a solid object-oriented approach must use what we call object-speak. That is, all processing should be discussed in object-oriented terms. That does not mean, however, that...
The book focuses on standard numerical methods, novel object-oriented techniques, and the latest Microsoft .NET programming environment. It covers complex number functions, data sorting and searching ...
The basic principles of object-oriented programming without the complicated clutter of traditional programming language syntax How to use Xcode, the main programming tool used for both OS X and iOS ...
C# (pronounced “See Sharp”) is a simple, modern, object-oriented, and type-safe programming language. C# has its roots in the C family of languages and will be immediately familiar to C, C++, and ...
From object-oriented programming to storing app data in iCloud, the fourth edition of this book covers everything you need to build apps for the iPhone, iPad, and Mac. You’ll learn how to work with ...
Object Oriented Programming Data Structures Exceptions JVM and Garbage Collection Threading Big O Notation Table of Contents Part 1: Soft Skills and Process 1 The Interview Process 2 Creating your ...
Written for programmers with a background in C++, Java or other high-level, object-oriented languages, this book applies the Deitel signature live-code approach to teaching programming and explores ...
Head First C# is a complete learning experience for object-oriented programming, C#, and the Visual Studio IDE. Built for your brain, this book covers Visual C# 2008, Visual Studio 2008, and the .NET ...