Send Close Add comments: (status displays here)
Got it!  This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
The Java programming language


1. The Java programming language

2. Installation
JavaJava is a strongly-typed general purpose programming language first released in 1995.

Oracle now owns Java (since 2009), having purchased what was left of Sun Microsystems.

For installation of Java, see Java

3. Virtual machine
Following the example of UCSD Pascal p-code and p-code machine in the 1970s, Java compiles to Java byte code and runs on the JVM (Java Virtual Machine) .

This allows the same Java byte code to run on multiple platforms, though one must take into account platform differences such as file systems, file name case sensitivity (Linux is case sensitive, Windows is case insensitive and case retentive).

4. Jamas Gossling
Java was developed by James Gosling (also Emacs editor) at Sun Microsystems, appeared in 1995, acquired by Oracle in 2010.

Gossling created Java with a C style syntax so it would be familiar to programmers at the time.

5. Java goals
There were five primary goals in the creation of the Java language:(from Wikipedia)

6. Java history
The Java standard is maintained by a community process of many committees.

7. Programs

8. Object-oriented
Java is class-based and object-oriented.

Java is not a pure object-oriented language, as is SmallTalk, since it has primitive types.

9. Projects and classes
A Java program is a collection of classes, one of which contains a main class.

Each class resides in a separate source file. The name of the class needs to match the name of the file.

The proliferation of classes in a project means a proliferation of source files which can be hard to manage.

10. Java
Like all languages, Java has good parts and it has bad parts. Are these properties good or bad?

11. Strong typing
Strong typing means that any change to a type can result in changes throughout the project.

Generics were added in 2004 to help address abstractions involving similar code but different types.

12. Primitive types
The strong typing issues are exasperated by the plethora of primitive types.

Consider integers. The following are primitive types. There are no unsigned types but there are unsigned methods to deal with unsigned values.

Should the programmer need to decide on which type to use? Some languages only provide one integer type.

13. Classes
The integer primitive types are different than the Integer class.

There is no structure or record type in Java. Instead, one must use classes to simulate structures or records.

14. Garbage collection
Garbage collection is needed to reclaim unused memory.

This can happen at any time, so for time-critical operations some care is needed (i.e., tricks, etc.) to do the garbage collection at the right time.

15. Language defects

16. Hello world
The (command line) Hello world program is more complex than in most languages. The GUI version much more complex.
public class hello {    public hello() {       System.out.print("Hello world\n");       }    public static void main(String [] args) {       new hello_01();       }    }


17. Null
In Java:

18. Other languages
There are some other languages that are built on Java, or, more precisely, the JVM.

19. More languages

20. Android
The Google Android operating system is built on a core Linux system and uses Java for the Android operating system applications.

But Google would like to replace Java with Kotlin, a Java alternative.

21. Seeing and thinking
Kaniza TriangleHow many triangles do you see?

22. Kanizsa triangle
Do you see the triangle?

Kanisza Triangle
There is no triangle! Your brain makes the triangle that you see.

Abstraction involves looking at similarities and differences and filling in missing details - sometimes appropriately, sometimes inappropriately.

23. More triangles
How many triangles do you see now? Do they exist?

Kanizsa Triangle
To many, the triangle that is seen but does not exist and appears brighter than the surrounding area.

24. Gaetano Kanizsa
This type of illusion was discovered/created by Gaetano Kanizsa who popularized such illusions, in part from his 1976 Scientific American paper on the subject (though he had been working on such ideas for many years before this paper).

25. With dots
The triangle is still seen when just dots are present at the corners.

Kanizsa Triangle
Can a triangle that does not exist be "whiter than white"? White is white, right?

26. Necker cube
Necker CubeHere is a Necker cube. Which corner nearest to the viewer?

Necker Cube
Do you see the Necker cube now? It does not exist except in your mind.

27. Dijkstra: thinking
The tools we use have a profound (and devious!) influence on our thinking habits, and, therefore, on our thinking abilities. Edsger Dijkstra (computer scientist) Dijkstra, E. (June 18, 1975). "How do we tell truths that hurt?", EWD 498.

How might or does your favorite IDE (Integrated Development Environment) effect the way you think and your thinking abilities?

28. Thinking
How do you think?

29. End of page

30. Acronyms and/or initialisms for this page