Home » programming

Java与C++在语言方面上的不同

By: Zhiqiang Ma On: Aug 16, 2008 Views: 2 No Comment Print Email
Tags: , ,

1,Java抛弃了头文件、预处理机制、goto语句和多维数组。
2,Java不支持指针。
3,Java抛弃了联合体和结构体。
4,Java不支持独立函数。所有函数必须在类中声明。
5,Java不支持多重继承,可以使用接口模拟多重继承。
6,Java不支持运算符重载。
7,Java中布尔型不再用整数来代替。
8,Java中主函数必须有一个字符串类型的参数。

Java抛弃的C++中的这些机制和结构多数都是“危险”的,减少了语言的复杂性,增强了安全性,虽然在一定程度上减少了其灵活性。

Read more:

Digg del.icio.us Stumble Techorati Facebook Newsvine Reddit Twitter
Mixx LinkedIn Google Bookmark Yahoo Bookmark MySpace LiveJournal Blogger RSS feed
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.