Program Structure


One main difference between C and Java is the fundamental program structure of the two languages. C programs are function based. The function is the primary building block of a C program. All statements except for #include statements, function prototypes , and global variable declarations are placed inside functions. A C program execution will largely consist of a series of function calls.

Java is an object-oriented language. The class is the primary building block of a Java program. Classes aren't all that mysterious . In simplistic terms, classes are just named blocks of code that can define both methods (functions) and data. Classes provide the blueprints for the objects that make Java object oriented. All executable statements in Java must be placed inside a class. A Java program execution will normally consist of creating one or more objects and manipulating the objects.

One similarity between Java and C is that both languages use a main() function (or method) to define the entry point for program execution. The system calls the main() function when the program is run.



Technical Java. Applications for Science and Engineering
Technical Java: Applications for Science and Engineering
ISBN: 0131018159
EAN: 2147483647
Year: 2003
Pages: 281
Authors: Grant Palmer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net