This file is indexed.

/usr/share/GNUstep/Documentation/Developer/Base/ProgrammingManual/gs-base/Objective_002dC-Java-and-C_002b_002b.html is in gnustep-base-doc 1.24.7-1build2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Objective-C GNUstep Base Programming Manual: Objective-C Java and C++</title>

<meta name="description" content="Objective-C GNUstep Base Programming Manual: Objective-C Java and C++">
<meta name="keywords" content="Objective-C GNUstep Base Programming Manual: Objective-C Java and C++">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Make.html#Make" rel="index" title="Make">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html#Top" rel="up" title="Top">
<link href="Java-and-Guile.html#Java-and-Guile" rel="next" title="Java and Guile">
<link href="Bundles-and-Frameworks.html#Bundles-and-Frameworks" rel="prev" title="Bundles and Frameworks">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<a name="Objective_002dC-Java-and-C_002b_002b"></a>
<div class="header">
<p>
Next: <a href="Java-and-Guile.html#Java-and-Guile" accesskey="n" rel="next">Java and Guile</a>, Previous: <a href="Bundles-and-Frameworks.html#Bundles-and-Frameworks" accesskey="p" rel="prev">Bundles and Frameworks</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Make.html#Make" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Differences-and-Similarities-Between-Objective_002dC_002c-Java_002c-and-C_002b_002b"></a>
<h2 class="appendix">Appendix C Differences and Similarities Between Objective-C, Java, and C++</h2>
<a name="index-Objective_002dC-and-Java_002c-differences-and-similarities"></a>
<a name="index-differences-and-similarities_002c-Objective_002dC-and-Java"></a>
<a name="index-Objective_002dC-and-C_002b_002b_002c-differences-and-similarities"></a>
<a name="index-differences-and-similarities_002c-Objective_002dC-and-C_002b_002b"></a>


<p>This appendix explains the differences/similarities between Objective-C and
Java. It does not cover the Java Interface to GNUstep (JIGS; see <a href="Java-and-Guile.html#Java-and-Guile">Java and Guile</a>), but is included to help people who want to learn Objective-C and know
Java already.
</p>

<a name="General"></a>
<h3 class="section">C.1 General</h3>

<ul>
<li> C programmers may learn Objective-C in hours (though real expertise
obviously takes much longer).

</li><li> Java has global market acceptance.

</li><li> Objective-C is a compiled OO programming language.

</li><li> Java is both compiled and interpreted and therefore does not offer
the same run-time performance as Objective-C.

</li><li> Objective-C features efficient, transparent Distributed Objects.

</li><li> Java features a less efficient and less transparent Remote Machine
Interface.

</li><li> Objective-C has basic CORBA compatibility through official C bindings,
and full compatibility through unofficial Objective-C bindings.

</li><li> Java has CORBA compatibility through official Java bindings.

</li><li> Objective-C is portable across heterogeneous networks by virtue of a
near omnipresent compiler (gcc).

</li><li> Java is portable across heterogeneous networks by using client-side JVMs
that are software processors or runtime environments.

</li></ul>


<a name="Language"></a>
<h3 class="section">C.2 Language</h3>

<ul>
<li> Objective-C is a superset of the C programming language, and may
be used to develop non-OO and OO programs. Objective-C provides
access to scalar types, structures and to unions, whereas Java
only addresses a small number of scalar types and everything else
is an object.  Objective-C provides zero-cost access to existing
software libraries written in C, Java requires interfaces to be
written and incurs runtime overheads.

</li><li> Objective-C is dynamically typed but also provides static typing.
Java is statically typed, but provides type-casting mechanisms to
work around some of the limitations of static typing.

</li><li> Java tools support a convention of a universal and distributed
name-space for classes, where classes may be downloaded from
remote systems to clients. Objective-C has no such conventions
or tool support in place. 

</li><li> Using Java, class definitions may not be extended or divided through
the addition of logical groupings.  Objective-C provides categories
as a solution to this problem.

</li><li> Objective-C provides delegation (the benefits of multiple inheritance
without the drawbacks) at minimal programming cost.  Java requires
purpose written methods for any delegation implemented.

</li><li> Java provides garbage collection for memory management.  Objective-C
provides manual memory management, reference counting, and garbage
collection as options.

</li><li> Java provides interfaces, Objective-C provides protocols.

</li></ul>


<a name="Source-Differences"></a>
<h3 class="section">C.3 Source Differences</h3>

<ul>
<li> Objective-C is based on C, and the OO extensions are comparable with
those of Smalltalk. The Java syntax is based on the C++ programming
language. 

</li><li> The object (and runtime) models are comparable, with Java&rsquo;s
implementation having a subset of the functionality of that
of Objective-C.

</li></ul>


<a name="Compiler-Differences"></a>
<h3 class="section">C.4 Compiler Differences</h3>
 
<ul>
<li> Objective-C compilation is specific to the target system/environment,
and because it is an authentic compiled language it runs at higher
speeds than Java.

</li><li> Java is compiled into a byte stream or Java tokens that are interpreted
by the target system, though fully compiled Java is possible.

</li></ul>


<a name="Developer_0027s-Workbench"></a>
<h3 class="section">C.5 Developer&rsquo;s Workbench</h3>

<ul>
<li> Objective-C is supported by tools such as GNUstep that provides
GUI development, compilation, testing features,
debugging capabilities, project management and database access.
It also has numerous tools for developing projects of different
types including documentation.

</li><li> Java is supported by numerous integrated development environments
(IDEs) that often have their origins in C++ tools.
Java has a documentation tool that parses source code and creates
documentation based on program comments. There are similar features
for Objective-C.

</li><li> Java is more widely used.

</li><li> Objective-C may leverage investment already made in C based tools.

</li></ul>


<a name="Longevity"></a>
<h3 class="section">C.6 Longevity</h3>

<ul>
<li> Objective-C has been used for over ten years, and is considered to be
in a stable and proven state, with minor enhancements from time to time.

</li><li> Java is evolving constantly.

</li></ul>


<a name="Databases"></a>
<h3 class="section">C.7 Databases</h3>

<ul>
<li> Apple&rsquo;s EOF tools enable Objective-C developers to build object
models from existing relational database tables. Changes in the
database are automatically recognised, and there is no requirement
for SQL development.

</li><li> Java uses JDBC that requires SQL development; database changes
affect the Java code. This is considered inferior to EOF. Enterprise
JavaBeans with container managed persistence provides a limited database
capability, however this comes with much additional baggage.  Other
object-relational tools and APIs are being developed for Java (ca. 2004), but
it is unclear which of these, if any, will become a standard.

</li></ul>


<a name="Memory"></a>
<h3 class="section">C.8 Memory</h3>

<ul>
<li> For object allocation Java has a fixed heap whose maximum size
is set when the JVM starts and cannot be resized unless the
JVM is restarted. This is considered to be a disadvantage in
certain scenarios: for example, data read from databases may
cause the JVM to run out of memory and to crash.

</li><li> Objective-C&rsquo;s heap is managed by the OS and the runtime system.
This can typically grow to consume all system memory (unless
per-process limits have been registered with the OS).

</li></ul>


<a name="Class-Libraries"></a>
<h3 class="section">C.9 Class Libraries</h3>
<ul>
<li> Objective-C: Consistent APIs are defined by the OpenStep specification.
This is implemented by GNUstep and Mac OS X Cocoa.  Third-party APIs are
available (called Frameworks).

</li><li> Java: APIs are defined and implemented by the Sun Java Development
Kit distributions.  Other providers of Java implementations (IBM, BEA, etc.)
implement these as well.

</li><li> The Java APIs are complex owing to the presence of multiple layers of
evolution while maintaining backwards compatibility.  Collections, IO, and
Windowing are all examples of replicated functionality, in which the copies
are incompletely separated, requiring knowledge of both to use.

</li><li> The OpenStep API is the result of continuing evolution but backward
compatibility was maintained by the presence of separate library versions.
Therefore the API is clean and nonredundant.  Style is consistent.

</li><li> The OpenStep non-graphical API consists of about 70 classes and about 150
functions.

</li><li> The equivalent part of the Java non-graphical API consists of about 230
classes.

</li><li> The OpenStep graphical API consists of about 120 classes and 30 functions.

</li><li> The equivalent part of the Java graphical API consists of about 450 classes.

</li></ul>


<hr>
<div class="header">
<p>
Next: <a href="Java-and-Guile.html#Java-and-Guile" accesskey="n" rel="next">Java and Guile</a>, Previous: <a href="Bundles-and-Frameworks.html#Bundles-and-Frameworks" accesskey="p" rel="prev">Bundles and Frameworks</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Make.html#Make" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>