Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Aphorismen
Applications
Business Economics & Admin.
My Computers
Cooking
Devices
Folders
Food
Hardware
Infos
Software Development
Sports
Operation Instructions
Todos
Test
Help
Glossary
Community portal
adaptions
Sidebar anpassen
Wiki RB4
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
JavaLanguage
(section)
Page
Discussion
English
Read
Edit
View history
Toolbox
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Difference between Java and C++== *no pointer and pointer arithmetic *no unsigned type specifier *no confusion between assignment and equality test *no manual memory allocation *no difference between definition and declaration (only declaration) *no goto *in Java you can call another ctor in a ctor *no initialisation in ctor initialization list *erweiterte Array Declaration und Laufzeitabfrage der Länge *no multiple inheritance but interfaces *Aufruf des Basisctors durch super() und Basismethoden durch super.<MethodenName>() *no templates *alle Referenzvariablen müssen mit new angelegt werden *'new Rectangle(100, 50).area()' is possible *alle Klassen haben als Basisklasse 'object' *garbage collection *methods can only be defined in the class body (no global functions); they are called methods rather than member functions. *es gibt nichts außerhalb des Kontextes einer Klasse *alle Elemente einer Klasse müssen in einer Quelldatei definiert werden *kein Präprozessor => kein include, keine Header *kein Überladen von Operatoren (Ausnahme ist + für Strings) *class declarations can be used in finy places e.g. as anonymous classes *alle Methoden von java Klassen sind virtual (ausser final,private,static) *different meaning of protected *multithreading is part of the Java language (synchronized) *different exception handling *variables declared in a for header go out of scope outside the for block *no line continuation with \ *no use of booleans as ints *no comma operator except in the initialization and increment section of a for loop *+ operator for strings *instanceof operator *>>> operator *& and | operators act a little bit different *labeled breaks (multi-level break) *There are no structs, pointer or unions *no enumerations *no bit fields *no variable length parameter list *weitaus eingeschränktere automatische casts *kein Zuweisung in expressions wie z.B. Method(x=getX(),a,b,c)
Summary:
Please note that all contributions to Wiki RB4 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Uwe Heuer Wiki New:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width