Java (2877)
Python (730)
Go (587)
JavaScript (451)
C++ (337)
C (312)
Fashion (100)
Ancient History (95)
CSS (92)
HTML (73)
Linux (72)
Public Speaking (68)
Economics (67)
History (66)
Modern History (66)
English Spoken (61)
Sociology (59)
Personal Development (58)
PHP (58)
Technology (57)
Ancient Bihar (56)
Web Development (51)
Software Testing (48)
Android (47)
MySQL (47)
Node.js (47)
Hosting (46)
National Day (46)
React (46)
Email (45)
International Day (45)
AWS (44)
English Grammar (44)
Elasticsearch (43)
Git (43)
Bhakti (42)
Bihar (42)
Blockchain (42)
SQL (42)
Introductory Sociology (32)
Microeconomics (28)
Interview Questions (17)
Social Institutions (14)
मांग और आपूर्ति (13)
Macroeconomics (7)
CodeIgniter (6)
Indian Economy (6)
Medieval History (5)
Laravel (4)
Accessibility (3)
Next.js (1)
Social Processes and Social Change (1)
  1. Home>>
  2. Topics>>
  3. Java
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌

Best Division

Spread Your Knowledge

  • All topics
  • About us
  • Contact us
  • Privacy policy
  • Terms of service
  • Copyright
  • Facebook
  • Twitter
  • Instagram
  • Youtube
  • LinkedIn
  • Pinterest
  • Github
  • Tumblr

© 2026 Best Division

Java

2,877 posts about Java: questions with answers, tutorials and articles, newest first.

JavaQuestion
Java

What Is Composition vs Inheritance in Java and Which Should You Prefer?

Prefer composition to inheritance in most Java code. See the has-a versus is-a difference, a fragile base class example and when extends is still right.

Jayant KumarJayant Kumar
Nov 30, 2026
JavaQuestion
Java

What Is the equals and hashCode Contract in Java?

Equal objects must have equal hash codes. This guide covers the equals and hashCode contract, the bugs that break it, and a correct implementation.

Jayant KumarJayant Kumar
Nov 30, 2026
JavaArticle
Java

What Is the Object Class in Java? equals, hashCode and toString

Every Java class inherits from Object. See what it gives you and how to override toString, equals and hashCode so objects print, compare and hash correctly.

Jayant KumarJayant Kumar
Nov 30, 2026
JavaQuestion
Java

What Is Method Overriding in Java and How Is It Different from Overloading?

Method overriding lets a subclass replace an inherited method, and the JVM picks the version at runtime. This guide covers the rules and the difference from overloading.

Jayant KumarJayant Kumar
Nov 29, 2026
JavaArticle
Java

What Is Polymorphism in Java? Compile-Time vs Runtime

Polymorphism lets one name or reference type behave in many ways. Compare overloading and overriding with runnable Java examples and a clear comparison table.

Jayant KumarJayant Kumar
Nov 29, 2026
JavaQuestion
Java

What Is Inheritance in Java and How Does extends Work?

Inheritance lets a subclass reuse and specialise a superclass using extends. See super, overriding, single inheritance and when composition is the better choice.

Jayant KumarJayant Kumar
Nov 29, 2026
JavaQuestion
Java

What Is Encapsulation in Java and How Do Getters and Setters Help?

Encapsulation hides a class's data behind methods so it can validate input and change internals safely. See getters, setters, immutability and records in Java.

Jayant KumarJayant Kumar
Nov 28, 2026
JavaQuestion
Java

What Are Access Modifiers in Java: public, private, protected, default?

Java has four access levels: private, default, protected and public. Learn what each allows, with a comparison table and examples for fields, methods and classes.

Jayant KumarJayant Kumar
Nov 28, 2026
JavaArticle
Java

What Is the static Keyword in Java? Variables, Methods, Blocks

The static keyword makes a member belong to the class instead of an object. See static variables, methods, blocks and nested classes with runnable examples.

Jayant KumarJayant Kumar
Nov 28, 2026
JavaArticle
Java

What Are Classes and Objects in Java? A Beginner Guide

A class is a blueprint and an object is an instance built from it. Build a small class, create objects with new, and learn constructors, this and references.

Jayant KumarJayant Kumar
Nov 27, 2026
JavaQuestion
Java

How Do You Format Numbers and Currency by Locale in Java?

Format numbers and money for any country with NumberFormat and Locale. Covers currency symbols, decimals, rounding, compact numbers, parsing and thread safety.

Jayant KumarJayant Kumar
Nov 27, 2026
JavaQuestion
Java

What Are Instant and ZonedDateTime in Java and When Do You Use Them?

Instant stores a moment on the UTC timeline; ZonedDateTime adds a zone and local clock. See conversions, DST pitfalls and when to choose each.

Jayant KumarJayant Kumar
Nov 27, 2026
JavaQuestion
Java

When Should You Use BigDecimal Instead of double in Java?

Use BigDecimal for money and exact decimals, not double. See why binary floats drift, how to build values safely, round, divide and compare.

Jayant KumarJayant Kumar
Nov 26, 2026
JavaQuestion
Java

How Do You Use the Math Class and Random Numbers in Java?

A practical tour of java.lang.Math and random number generation in Java: rounding rules, overflow-safe maths and how to pick a number in a range.

Jayant KumarJayant Kumar
Nov 26, 2026
JavaQuestion
Java

What Are Wrapper Classes, Autoboxing and Unboxing in Java?

Wrapper classes turn Java primitives into objects, and autoboxing converts between them automatically. Learn the caching trap, null pitfalls and speed costs.

Jayant KumarJayant Kumar
Nov 26, 2026
JavaQuestion
Java

How Do You Format Strings in Java with printf and String.format?

Use String.format and printf to build aligned, padded and rounded text in Java. Covers %s, %d, %f, flags, locales and common exceptions.

Jayant KumarJayant Kumar
Nov 25, 2026
JavaQuestion
Java

How Do You Use StringBuilder Efficiently for Large Text in Java?

StringBuilder builds large text in linear time while String += in a loop is quadratic. Learn capacity, key methods and when to pick other tools.

Jayant KumarJayant Kumar
Nov 25, 2026
JavaQuestion
Java

How Do You Compare Strings in Java: equals, compareTo and ignoreCase?

Use equals for content, equalsIgnoreCase to ignore case and compareTo for ordering. See why == is wrong and how to avoid NullPointerException.

Jayant KumarJayant Kumar
Nov 25, 2026
JavaQuestion
Java

What Is the Difference Between Pass by Value and Pass by Reference in Java?

Java is strictly pass by value, even for objects. Learn how references are copied, why swap fails and why Strings never change inside a method.

Jayant KumarJayant Kumar
Nov 24, 2026
JavaArticle
Java

How Does Recursion Work in Java? Examples and Pitfalls

Recursion in Java is a method calling itself on a smaller input. See how the call stack works, classic examples and how to avoid StackOverflowError.

Jayant KumarJayant Kumar
Nov 24, 2026

Hmm... Want More

Please try with different query
Page 1Older posts →