CoreJava - Chapter 1: Introduction to Java

1.1 Java as a Programming Platform

  • Java is not only a programming language, but also a platform

1.2 The Java "White Paper" Buzzwords

  1. Simple 
    • Compared to C++
    • Small: 40k for the size of the basic interpreter and class support; 175k for the basic standard libarries and thread support
  2. Object-Oritented
    • Comparable to C++
    • The major difference between Java and C++ lies in multiple inheritance, which Java has replaced with a simpler concept of interfaces
  3. Distributed
    • Java has an extensive library of routines for coping with TCP/IP protocols like HTTP and FTP
  4. Robust
    • Java puts a lot of emphasis on early checking for possible problems, later dynamic checking, and eliminating situations that are error-prone
    • The single biggest difference between Java and C/C++ is that Java has a pointer model that eliminates the possibility of overwriting memory and corrupting data
  5. Secure
  6. Architecture-Neutral
    • The complier generates an architecture-neutral object file format. The complied code is executable on many processors, given the presence of the Java runtime system
    • Q: What is the role of virtual machine in enabling the Architecture-Neutral feature in Java?
  7. Portable
    • The size of primitive data type in Java is fixed
    • Binary data is stored and transmitted in a fixed format, eliminating confusion about byte ordering
    • Strings are saved in a standard Unicode format
  8. Interpreted
    • Java interpreter can execute Java vytecodes directly on any machine to which the interpreter has been ported
    • Q: What is the role of linking in enabling the Interpreted feature in Java?
  9. High-performance
    • A "just-in-time" compiler have become so good that they are competitive with traiditonal compilers
    • Q: What is the difference between "just-in-time" compilers and traditional compilers?
  10. Multithreaded
    • Java is the first mainstream language to support concurrent programming
  11. Dynamic
    • Libraries can freely add new methods and instance variables without any effect on their clients

1.3 Java Applets and the Internet

  • Applets: Java programs that work on web pages are called applets; to use an applet, you only need a Java-enabled web brower

1.4 A Short History of Java

  • Java was first released in 1996
  • Java goes back to 1991, when a group of Sun engineers, led by Patrick Naughton and James Gosling, wanted t odesign a small computer language that could be used for consuer devices like cable TV switchboxes
  • The Sun people came from a UNIX background, so they based their language on C++
  • The Green Project 

1.5 Common Misconceptions about Java

  • Java is an extension of HTML -> Java is a programming language; HTML is a way to describe hte structure of a web page
  • I use XML, so I don't need Java -> Java is a programming language; XML is a way to describe data. You can process XML data with any programming language, but Java API contains excellent support for XML processing
  • Java is proprietary, and should therefore be avoided -> When Java was first created, Sun gave free licenses to distribute and end users
  • Java is interpreted, so it is too slow for serious applications -> In the early days of Java, the langauge was interpreted. Nowadays, the Java virtual machine uses a just-in-time compiler. 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值