Skip to content

50 facts

50 Fun Facts About Java Programming

Learn something new, then test yourself with the quiz.

Know these facts? Prove it.

Take the 50-question quiz
1

The Java language takes its name from a variety of which drink grown on an Indonesian island?

Coffee from the island of Java supplied the name after the language's first title ran into a trademark problem. The team's project had also gone by the code name Green.

2

Which sandbox game did Markus Persson originally write in Java, the language still named in its original edition?

Minecraft kept its original Java version alive even after a separate edition, Bedrock, was built. The two are updated side by side, with small differences between them.

3

Which mobile operating system, built on the Linux kernel, originally offered Java as the only language for its apps?

Android made Java the only option for app code at first, yet it never used a standard JVM. Its own runtime executes a different compiled format.

4

Which software company became Java's steward through its 2009–10 acquisition of Sun Microsystems?

Oracle agreed in April 2009 to pay US$7.4 billion for Sun. European regulators did not approve the takeover until January 2010.

5

Which home-video disc format requires every player to include Java, which powers its interactive menus?

Blu-ray made Java a mandatory part of its standard, a decision announced at the 2005 JavaOne trade show. The older DVD format handles its menus by a different method.

6

Before it was renamed, Java was called what, after a tree that stood outside its designer's office?

Oak had to go when a trademark search found the name was already used by a company called Oak Technology.

7

JavaScript is unrelated to Java; what was it called in its 1995 beta, before a marketing-driven rename?

LiveScript became JavaScript within three months, in time for the official release in December 1995. Its creator, Brendan Eich, considered the new name a marketing ploy.

8

Which company won a 2021 US Supreme Court fair-use ruling over Java API code in its smartphone software?

Google won 6–2. The justices found its copying of about 11,500 lines was fair use, and sidestepped the question of whether such code can be copyrighted at all.

9

What were the small Java programs that ran inside web pages in 1990s browsers called?

Applets arrived with the first version of Java in 1995 and helped make the language popular. Browsers began phasing out support in 2013, and Java itself deprecated them in 2017.

10

Which Canadian computer scientist, known as the father of Java, designed the language at Sun Microsystems?

James Gosling launched the Java project in June 1991 with Mike Sheridan and Patrick Naughton. He left Sun in April 2010, soon after its takeover.

11

What is the name of Java's mascot, who debuted as a smart agent on Sun's 1992 Star7 handheld prototype?

Duke began as an on-screen helper for users of the Star7, a handheld built to demonstrate the technology. Sun later released his artwork under a free licence, so developers may adapt him.

12

Which hexadecimal 'magic number', spelling out two English words, begins every compiled Java class file?

CAFEBABE was chosen by Java's designer while hunting for four-letter hex words to follow CAFE. A sister file format got CAFEDEAD, after his team's nickname for a Palo Alto restaurant.

13

At Java's 1995 launch, Marc Andreessen announced that which company's browsers would support the language?

Netscape's pledge came unexpectedly, alongside the first public release of Java at the SunWorld conference on 23 May 1995.

14

Java EE was renamed after a trademark dispute, taking a name shared with which city on the island of Java?

Jakarta replaced Java in the platform's name because the trademark's owner and the foundation taking over the project could not agree on its use.

15

Which company stopped bundling Java with its operating systems after Sun sued it over incompatible changes?

Microsoft had added Windows-specific classes to its bundled Java runtime and offered them through its Visual J++ development tool, which is what drew the lawsuit.

16

Java's designer first tried to adapt which existing language before abandoning it to build a new one?

C++ still left its mark: Java was given a C++-style syntax so that system and application programmers would find it familiar.

17

Which JetBrains language was named after an island near Saint Petersburg, in imitation of Java's own name?

Kotlin's designers picked an island's name to echo Java, which shares its own with an Indonesian island. The language is designed to interoperate fully with Java.

18

Which fantasy MMORPG from Jagex launched in 2001 as a Java game played in a web browser?

RuneScape ran on its original Java client for 15 years before a standalone replacement largely took over in 2016. Guinness World Records has listed it as the MMO with the most users.

19

Which big-data framework, written mostly in Java, was named after a toy elephant owned by its creator's son?

Hadoop was named by Doug Cutting, who borrowed the word from his son's toy elephant. The framework needs a Java runtime on the machines that run it.

20

Java compilers turn source files into which intermediate form, instead of architecture-specific machine code?

Bytecode gets its name because each instruction's operation code fits in one byte. Any JVM can run it regardless of the computer underneath, which is what makes Java programs portable.

21

Which method does the JVM call first as the entry point of every standalone Java application?

main receives any command-line arguments as an array of strings. A program may hold several classes with such a method, so which one runs is settled outside the code.

22

Which statement prints a line of text to standard output in the traditional Java Hello World program?

System.out.println is a rite of passage for beginners. Java 25 added a class named IO to give simpler access to the same output stream.

23

Which Java keyword does a class declaration use to name the single superclass it builds on?

extends names the one superclass a class may have. A class that leaves it out still has a parent, because it then descends implicitly from the built-in Object class.

24

Which Java keyword stops a variable from being reassigned and a class from being subclassed?

final marks something that can be defined only once. Java also reserves const, the word other languages use for constants, but gives it no function at all.

25

Which Java keyword makes a field or method belong to the class itself instead of to each instance?

static fields exist as one copy per class, however many instances are created. Methods marked with it can be called without creating an object at all.

26

Which Java access modifier lets a field be reached only by other members of its own class?

private members can be reached only from inside their own class. Its neighbour protected also admits subclasses and classes from the same package.

27

Which Java keyword marks a class that cannot be instantiated and may contain methods with no body?

abstract classes leave their subclasses to supply the missing method bodies. Oddly, a class may carry the keyword without having a single bodiless method.

28

In a Java method declaration, which keyword signals that the method hands nothing back to its caller?

void sits where a return type would normally go. Every program's entry-point method must use it, and passes any exit status to the operating system by another route.

29

Which jump statement from older languages is a reserved word in Java, even though it has no function there?

goto is reserved but unused, so a Java programmer cannot even name a variable after it. In other languages it jumps to a labelled line elsewhere in the program.

30

Which Java primitive type, named in honour of a 19th-century pioneer of logic, holds only true or false?

boolean honours George Boole, who first defined an algebraic system of logic. C++, C# and Python shorten the type's name to bool.

31

A Java JAR archive is built on which common compressed file format, so standard extraction tools can open it?

ZIP underlies every JAR, a package that gathers many Java class files and their resources into one file for distribution. The name is short for Java archive.

32

Which Java download adds a compiler, a debugger and other tools to the runtime that ordinary users need?

JDK stands for Java Development Kit. End users traditionally needed only the JRE, the runtime environment, to launch finished programs on their own devices.

33

Java spares programmers from freeing memory by hand through which process that reclaims unreachable objects?

Garbage collection frees an object's memory once no references to it remain. Java offers several collectors, and the one known as G1 became the default in Java 9.

34

Which technique lets a JVM translate Java code into native machine code while the program is already running?

Just-in-time compilation gave Java a significant speed boost when it arrived for Java 1.1 in the late 1990s. The language had a reputation for being slow and memory-hungry.

35

Java names can contain letters from almost any script because the language is written in which text standard?

Unicode letters are all legal in Java names, so a variable can be spelled in Greek or Japanese. Even Roman numeral symbols count as letters for the purpose.

36

Which Java primitive type is the language's only unsigned one, with a range running from 0 to 65,535?

char is unsigned because it exists to hold text symbols, not to do arithmetic. Every other primitive number in Java is signed, a contrast with C# and its unsigned variants.

37

Java strings cannot be altered once created, so which mutable class assembles text piece by piece?

StringBuilder exists because every alteration to an ordinary String has to create a whole new one. The trade-off has an upside: unchangeable strings are simpler and fully thread-safe.

38

In Java, using == on two String variables tests whether they share what, rather than matching text?

The same object is all that == looks for, so two separate strings holding identical text compare as unequal. The equals method compares the text itself.

39

Which Java exception is thrown when a program tries to use an empty reference where an object is required?

NullPointerException, or NPE to its many victims, is a runtime exception, so the compiler does not insist that code prepare for it.

40

In Java, which kind of exception must a method either declare in its signature or handle itself?

Checked exceptions are verified at compile time, which cuts down on unhandled errors surfacing while a program runs.

41

Java 8 added language-level support for which long-debated feature, unofficially known as closures?

Lambda expressions were planned for Java 7 but were dropped and shipped in Java 8 instead. They opened the door to functional-style operations on streams of elements.

42

Which feature, added in Java 5, lets a List declare what it holds and removes the need for most typecasts?

Generics moved a whole family of mistakes from run time to compile time, because the compiler can reject a wrong kind of element before the program ever starts.

43

Which Java keyword makes a thread acquire an object's lock, so only one thread at a time runs the guarded code?

synchronized code releases its mutex lock automatically when execution leaves it. The keyword works on methods and blocks only: fields and classes cannot be declared with it.

44

In Java, how are the arguments of a method call always passed, even when they refer to objects?

By value holds even for objects: the method receives a copy of the reference, so reassigning the parameter inside the method has no lasting effect on the caller.

45

Who wrote the programming guide Effective Java, a Jolt Award winner that has run to three editions?

Joshua Bloch wrote from experience: he had led the design of numerous Java platform features, among them the java.math package and the assert mechanism.

46

Java 9 introduced which interactive read-eval-print tool, a standard way to try code line by line?

JShell filled a long-standing gap: before it, trying Java interactively usually meant a third-party tool such as BeanShell, which had drifted away from the real language.

47

Sun began releasing Java as free software in 2006 under which licence, also used by the Linux kernel?

GPL terms covered much of Sun's JVM from November 2006. By May 2007 the company had opened all the core code, apart from a small portion it did not hold the copyright to.

48

Which GUI toolkit was developed to give Java a more sophisticated set of components than the earlier AWT?

Swing components are not implemented by platform-specific code, unlike their AWT predecessors. It began as a separate download and joined standard Java with release 1.2.

49

Which JVM, built on technology from the Smalltalk implementation Strongtalk, became Sun's default in Java 1.3?

HotSpot takes its name from its behaviour: as a program runs, it keeps looking for hot spots, the code executed most often, and concentrates its optimising there.

50

In Java, what shares its class's name, has no return type, and runs when an object is created?

Constructor code is supplied by the Java compiler when a programmer writes none: it quietly inserts a default one that never appears in the file the programmer wrote.

Think you know Java Programming?

Put these facts to the test with the interactive quiz.

Take the 50-question quiz

Teaching Java Programming?

Make a custom quiz — handy for classrooms and study groups.

Make a quiz on anything

Related quizzes