Java Programming
0Loading crowd target
0Loading crowd target
6correct to beat the crowd
50 free Java Programming trivia questions with answers — science & nature quiz, new questions added Oct 2026.
Java has been running quietly behind everyday life since the mid-1990s: in bank systems, phone apps, set-top boxes and some of the most popular games ever made. It is also one of the first languages many students meet, which makes it a natural subject for a quiz that mixes classroom knowledge with good stories. The questions here start with the basics a first course covers, such as the keywords that shape a class, how a program starts and what happens to memory you no longer need. From there they move into how the platform works under the hood, the features added over the years, and the tools and software built with it. Mixed in are the fun facts: how the language got its name, who designed it, the courtroom fights over who may use it and the in-jokes hidden in its file formats. It works as revision before a class test or a technical interview, and as a trivia round for anyone who has ever chased a missing semicolon. Every answer comes with a short explanation, so a wrong guess still teaches you something.
30 of 50 questions with answers and explanations. Play the quiz
Q 01The Java language takes its name from a variety of which drink grown on an Indonesian island?
Coffee
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.
Q 02Which sandbox game did Markus Persson originally write in Java, the language still named in its original edition?
Minecraft
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.
Q 03Which mobile operating system, built on the Linux kernel, originally offered Java as the only language for its apps?
Android
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.
Q 04Which software company became Java's steward through its 2009–10 acquisition of Sun Microsystems?
Oracle
Oracle agreed in April 2009 to pay US$7.4 billion for Sun. European regulators did not approve the takeover until January 2010.
Q 05Which home-video disc format requires every player to include Java, which powers its interactive menus?
Blu-ray
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.
Q 06Before it was renamed, Java was called what, after a tree that stood outside its designer's office?
Oak
Oak had to go when a trademark search found the name was already used by a company called Oak Technology.
Q 07JavaScript is unrelated to Java; what was it called in its 1995 beta, before a marketing-driven rename?
LiveScript
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.
Q 08Which 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.
Q 09What were the small Java programs that ran inside web pages in 1990s browsers called?
Applets
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.
Q 10Which Canadian computer scientist, known as the father of Java, designed the language at Sun Microsystems?
James Gosling
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.
Q 11What is the name of Java's mascot, who debuted as a smart agent on Sun's 1992 Star7 handheld prototype?
Duke
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.
Q 12Which hexadecimal 'magic number', spelling out two English words, begins every compiled Java class file?
CAFEBABE
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.
Q 13At Java's 1995 launch, Marc Andreessen announced that which company's browsers would support the language?
Netscape
Q 21Which method does the JVM call first as the entry point of every standalone Java application?
main
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.
Q 22Which statement prints a line of text to standard output in the traditional Java Hello World program?
System.out.println
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.
Q 23Which Java keyword does a class declaration use to name the single superclass it builds on?
extends
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.
Netscape's pledge came unexpectedly, alongside the first public release of Java at the SunWorld conference on 23 May 1995.
Q 14Java EE was renamed after a trademark dispute, taking a name shared with which city on the island of Java?
Jakarta
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.
Q 15Which company stopped bundling Java with its operating systems after Sun sued it over incompatible changes?
Microsoft
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.
Q 16Java's designer first tried to adapt which existing language before abandoning it to build a new one?
C++
C++ still left its mark: Java was given a C++-style syntax so that system and application programmers would find it familiar.
Q 17Which JetBrains language was named after an island near Saint Petersburg, in imitation of Java's own name?
Kotlin
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.
Q 18Which fantasy MMORPG from Jagex launched in 2001 as a Java game played in a web browser?
RuneScape
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.
Q 19Which big-data framework, written mostly in Java, was named after a toy elephant owned by its creator's son?
Hadoop
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.
Q 20Java compilers turn source files into which intermediate form, instead of architecture-specific machine code?
Bytecode
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.
Q 24Which Java keyword stops a variable from being reassigned and a class from being subclassed?
final
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.
Q 25Which Java keyword makes a field or method belong to the class itself instead of to each instance?
static
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.
Q 26Which Java access modifier lets a field be reached only by other members of its own class?
private
private members can be reached only from inside their own class. Its neighbour protected also admits subclasses and classes from the same package.
Q 27Which Java keyword marks a class that cannot be instantiated and may contain methods with no body?
abstract
abstract classes leave their subclasses to supply the missing method bodies. Oddly, a class may carry the keyword without having a single bodiless method.
Q 28In a Java method declaration, which keyword signals that the method hands nothing back to its caller?
void
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.
Q 29Which jump statement from older languages is a reserved word in Java, even though it has no function there?
goto
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.
Q 30Which Java primitive type, named in honour of a 19th-century pioneer of logic, holds only true or false?
boolean
boolean honours George Boole, who first defined an algebraic system of logic. C++, C# and Python shorten the type's name to bool.