JAVA编程思想英文参考文献和翻译

时间:2016-11-15 14:44来源:毕业论文

虽然java是基于C++基础上的,但是它更是纯粹的面向对象语

“If we spoke a different language, we would perceive a somewhat different world.”3670

Ludwig Wittgenstein (1889-1951)

Although it is based on C++, Java is more of a “pure” object-oriented language.

Both C++ and Java are hybrid languages, but in Java the designers felt that the hybridization was not as important as it was in C++. A hybrid language allows multiple programming styles; the reason C++ is hybrid is to support backward compatibility with the C language. Because C++ is a superset of the C language, it includes many of that language’s undesirable features, which can make some aspects of C++ overly complicated.

The Java language assumes that you want to do only object-oriented programming. This means that before you can begin you must shift your mindset into an object-oriented world (unless it’s already there). The benefit of this initial effort is the ability to program in a language that is simpler to learn and to use than many other OOP languages. In this chapter you’ll see the basic components of a Java program and learn that (almost) everything in Java is an object.

You manipulate objects with references

Each programming language has its own means of manipulating elements in memory. Sometimes the programmer must be constantly aware of what type of manipulation is going on. Are you manipulating the element directly, or are you dealing with some kind of indirect representation (a pointer in C or C++) that must be treated with a special syntax?

All this is simplified in Java. You treat everything as an object, using a single consistent syntax. Although you treat everything as an object, the identifier you manipulate is actually a “reference” to an object.1 You might imagine a television (the object) and a remote control (the reference). As long as you’re holding this reference, you have a connection to the television, but when someone says, “Change the channel” or “Lower the volume,” what you’re manipulating is the reference, which in turn modifies the object. If you want to move around the room and still control the television, you take the remote/reference with you, not the television.

Also, the remote control can stand on its own, with no television. That is, just because you have a reference doesn’t mean there’s necessarily an object connected to it. So if you want to hold a word or sentence, you create a String reference:

String s;

But here you’ve created only the reference, not an object. If you decided to send a message to s at this point, you’ll get an error because s isn’t actually attached to anything (there’s no television). A safer practice, then, is always to initialize a reference when you create it:

String s = "asdf";

However, this uses a special Java feature: Strings can be initialized with quoted text. Normally, you must use a more general type of initialization for objects.

You must create all the objects

When you create a reference, you want to connect it with a new object. You do so, in general, with the new operator. The keyword new says, “Make me a new one of these objects.” So in the preceding example, you can say:

String s = new String("asdf");

Not only does this mean “Make me a new String,” but it also gives information about how to make the String by supplying an initial character string.

Of course, Java comes with a plethora of ready-made types in addition to String. What’s more important is that you can create your own types. In fact, creating new types is the fundamental activity in Java programming, and it’s what you’ll be learning about in the rest of this book.

Where storage lives

It’s useful to visualize some aspects of how things are laid out while the program is running—in particular how memory is arranged. There are five different places to store data: JAVA编程思想英文参考文献和翻译:http://www.lwfree.com/fanyi/lunwen_71.html

------分隔线----------------------------

java编程思想 文献_JAVA编程思想英文参考文献和翻译相关推荐

  1. java编程思想读书_JAVA编程思想读书记(一)

    JAVA是面向对象的语言,这一点每一个开发者都知道.但是享受于在myeclipse上自动生成,自动解决一切问题的时候,有些基础的我们也许会忘掉.我能明显感觉到自己对于软件的依赖以及基础知识的流失,所以 ...

  2. 关于java的外语文献_java英文参考文献

    近年来,随着我国科学的技术的飞速发展,计算机语言的内容和形式得到了极大的丰富,特别是java语言的广泛应用,它不仅是计算机语言的重要组成部分,同时也是我国程序编写的重要内容之一,java语言的出现和广 ...

  3. java编程思想 入门_java编程思想学习(基础)

    第一章 java介绍 1.编程的本质: 机器空间:解空间 问题空间:实际需要解决的业务问题,将该问题抽象化,在解空间中对问题建模. 编程就是建立问题空间和机器空间中的关联 面向对象编程思想: 1.万物 ...

  4. java 编程思想 笔记_java编程思想笔记20170215

    importjava.util.ArrayList;importjava.util.List;public classTest {public static voidmain(String[] arg ...

  5. java 为什么违例差错控制_JAVA编程思想学习 — 第九章 (违例差错控制)

    1.违例自变量 和 Java 的其他任何对象一样, 需要用 new 在内存堆里创建违例,并需调用一个构建器.在所有标准违例中,存在着两个构建器: 第一个是默认构建器,第二个则需使用一个字串自变量,使我 ...

  6. java 编程思想 并发_java编程思想-java中的并发(一)

    一.基本的线程机制 并发编程使我们可以将程序划分为多个分离的.独立运行的任务.通过使用多线程机制,这些独立任务中的每一个都将由执行线程来驱动. 线程模型为编程带来了便利,它简化了在单一程序中同时jia ...

  7. java编程思想 接口_java编程思想——接口

    接口与内部类为我们提供了一种接口与实现分离的更加结构化的方法. 1.抽象类与抽象方法 抽象类,作为普通的类和接口之间的一种中庸之道. 抽象方法:仅有声明而没有方法体,如abstract void pl ...

  8. java递归 优点缺点_java编程之递归算法总结

    1.何为递归 个人理解就是自己调用自己,直到满足一个条件结束自己调用自己的过程,这个就是递归.举一个通俗的点的例子: 假设你在一个电影院,你想知道自己坐在哪一排,但是前面人很多,你懒得去数了,于是你问 ...

  9. java面试算法总结_java编程面试过程中常见的10大算法概念汇总

    以下是在编程面试中排名前10的算法相关的概念,我会通过一些简单的例子来阐述这些概念.由于完全掌握这些概念需要更多的努力,因此这份列表只是作为一个介绍.本文将从Java的角度看问题,包含下面的这些概念: ...

最新文章

  1. java十个整数相反顺序_编写程序,对输入的一个整数,按相反顺序输出该数。例如,输入为 3578, 输出为 8753。...
  2. Docker初学1:初识Docker
  3. Redis Python 客户端
  4. mongodb全套配置
  5. 全局变量-global关键字修改全局变量
  6. Springboot项目与vue项目整合打包
  7. lg手机历史机型_LG手机业务亏损增加70% 宣称主因是国产品牌卖的太便宜
  8. 华硕笔记本linux触摸板驱动,华硕笔记本触摸板驱动安装教程及打开方法
  9. aida64怎么测试cpu稳定性_怎么测试电脑CPU稳定性
  10. 计算机word加边框,Word2010怎样为段落加上边框
  11. 关于gitlab报错 would clobber existing tag 的解决办法
  12. Vue源码阅读(28):mergeOptions() 方法源码解析
  13. 教你识别显存颗粒编号
  14. 做开发你遇到最无理的需求是什么?
  15. windows64位jdk678网盘下载
  16. UltraEdit 27.0.0.24 中文版 — 文本代码编辑工具
  17. 安卓通过SQLite实现登录注册功能(小白式教程)
  18. [蓝桥杯 2018 国 B] 搭积木 (区间dp + 二维前缀和优化)
  19. 【Java】两层for循环 break跳出
  20. dede服务器建站_如何用DEDECMS建站的详细新手指南

热门文章

  1. 万字长文之JDK1.8的LinkedList源码解析
  2. 用chatgpt写论文可行吗,查重率会达到多少
  3. Ehcache 中ehcache.xml 配置详解和示例
  4. 连小白都能看懂的微信开发之微信网页授权 + 获取微信用户信息
  5. Python爬虫入门实例八之股票数据定向爬取并保存(优化版)
  6. 定期沟通及反馈的必要性
  7. pymysql模块和SQL注入
  8. Cool Edit Pro 2.1.0 官方免费下载
  9. 基于 Pyjwt 的 Flask 用户授权登录
  10. 抖音、快手、视频号排兵布阵VR直播