Java Programming Coding Interview Questions 1 | Code Factory

Donate : Link

WordPress Blog : Link

1. BigDecimal to work with currencies

- Why You Should Never Use Float and Double for Monetary Calculations

- Make cents with BigDecimal

- Choosing data type for monetary Calculation

Output :

2. How to access protected variables in another class in Inheritance

Why does this work? -> Because you’ve inherited the class. That means you’ve got all of its methods and it’s variables. Now, because your method and variable is protected, it also means that it can be accessed from the subclass.

3. equals() and hashCode()

Output :

4. Wrapper class MIN-VALUE

Output :

5. Daemon and User Thread

Output :

6. instanceof example

7. Static Non Static Block

Output :

8. String example

9. Fibonacci series

Output :

10. Reverse Number

11. Armstrong Number

12. Leap Year

Output :



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store