Skip to content

KaiqueParra/java-edge-cases

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Edge Cases & Best Practices

Java Status License Commits

Repository with simple Java examples focused on understanding how the language works in practice.

The goal is to explore common pitfalls, internal behavior and best practices used in real-world scenarios.


📚 Content

  • String comparison (== vs .equals())
  • Primitive vs Wrapper types
  • Null handling
  • Pass-by-value behavior
  • String Pool and immutability
  • Static vs instance context
  • Arrays vs Collections

📅 Progress

  • Day 1 - String Comparison
  • Day 2 - int vs Integer
  • Day 3 - NullPointerException
  • Day 4 - Pass by Value
  • Day 5 - String Immutability
  • Day 6 - Static vs Instance
  • Day 7 - Arrays vs ArrayList
  • Day 8 - equals() vs hashCode()
  • Day 9 - Exception Handling

🚀 How to Run

1. Compile

javac src/StringComparison.java

2. Run

java -cp src StringComparison


🎯 Objective

Practice Java daily by writing small examples that:

  • Improve logic and understanding
  • Reinforce core concepts
  • Simulate real interview topics

🧪 Example

  • String Comparison — == vs .equals()
  • int vs Integer — primitive vs wrapper behavior
  • NullPointerException — null reference behavior
  • Pass by Value — how Java handles method parameters
  • String Immutability — how Strings behave internally
  • Static vs Instance — shared class members vs object members
  • Arrays vs ArrayList — fixed-size vs dynamic collections
  • equals() vs hashCode() — object comparison and hash collections
  • Exception Handling — try, catch and finally behavior

📄 See /docs for detailed explanations


👨‍💻 Author

GitHub LinkedIn

Releases

No releases published

Packages

 
 
 

Contributors

Languages