Practical
Embedded Java

Java Fundamentals


A practical engineering approach to using embedded Java in real-world applications.


...



Summary Here

What is Java, exactly?

Java is a general-purpose, strongly-typed, concurrent, class-based, object-oriented language.

Java is what I would call a "high-level, high-level" language in that details of any particular machine representation are not available through the language, and the language constructs do not parallel any particular machine implementation. This is in contrast to C which I would consider a "high-level, low-level" language, since details of a machine representation are typically available through the language, although C does not parallel any particular machine implementation.

Java is more similar to C than to C++.

ref: The Java™ Language Specification, Second Edition


Overview of Java fundamentals
Object An instance of a class.
Class A template for a collection of data, information about that data, and executable code related to that data. Classes are the fundamental unit of Java program structure. Classes can contain fields, methods, and other classes.
Inner class A class within a class. There are four types of inner classes, which we will discuss later. At compile time, inner class definitions produce additional class files. These class files have names combining the inner and outer class names, such as MyClass$MyInnerClass.class.
Field A field is a member of a class and is an item of data. Class fields are simply variables, just as they are in C.
Method A method is member of a class and is a named collection of executable Java code. Methods can accept parameters and return values. Methods are very similar to C functions.
Package A collection of related classes. Java has a specific package naming convention which avoids the naming conflicts which give C programmers headaches.
Java primitive integral types The values of the integral types are integers in the following ranges:
• For byte, from –128 to 127, inclusive
• For short, from –32768 to 32767, inclusive
• For int, from –2147483648 to 2147483647, inclusive
• For long, from –9223372036854775808 to 9223372036854775807, inclusive
• For char, from '\u0000' to '\uffff' inclusive, that is, from 0 to 65535
Java programs

Every Java program consists of at least one Java class file. Source code file names must have .java suffixes, class file names must have .class suffixes, and both source and class files must have root names that identify the class. For example, a class called MyClass would be written in a source file called MyClass.java and compiled into a bytecode class file called MyClass.class. So a Java class must:

  1. contain a method: public static void main(String args[])
  2. contain a class with the same name as the class file. It may contain other classes too.

 
Systronix® 939 Edison St, Salt Lake City, Utah, USA 84111
Tel +1-801-534-1017, Fax +1-801-534-1019
contact us     Time Zone: MDT (UTC-6)
 

Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
Systronix is independent of Sun Microsystems, Inc.
TStik, JStik, JCX, JStamp, JSimm, JDroid, and JRealTime are trademarks of Systronix, Inc.
1-Wire, iButton and TINI are trademarks of Dallas Semiconductor
Simmstick is a trademark of Dontronics
LEGO® is a trademark of Lego A/S, Denmark