Core Java interview
- 23 October
OCAJP – Practice Questions for Static Keyword
I have started writing about the Java Certifications and how to prepare for the various topics related to OCAJP exams in my blog. In my previous post, I have published how to handle exceptions and few sample mock questions for StringBuilder class. In this post I am going to explain write down few more practice […]
- 19 October
Exception handling in java
Exceptions I have started writing about the and how to prepare for the various topics related to OCAJP exams in my blog. In my previous post, I have published few sample mock questions for StringBuilder class. In this post I am going to explain about the another OCAJP exam objective “Differentiate among checked exceptions, unchecked […]
- 17 July
How to create custom exception in java
In this post, we will see how to create custom exception in java. It is very simple to create custom exception in java. You just need to extends Exception class to create custom exception. Lets understand this with example. You have list of counties and if You have “USA” in list of country, then you […]
- 15 July
Find all Permutations of a String in java
In this post, we will see how to find all permutations of String in java. We will use a very simple approach to do it. Take out first character of String and insert into different places of permutations of remaining String recursively. Lets say you have String as ABC. So we take out A from […]
- 14 July
Difference between checked and unchecked exception in java
In this post, we will see difference between checked and unchecked exception in java. It is important question regarding exceptional handling. What is Exception? Exception is unwanted situation or condition while execution of the program. If you do not handle exception correctly, it may cause program to terminate abnormally. What is checked exception? Checked exceptions […]
- 13 July
Difference between StringBuffer and StringBuilder in java
In this post, we will see difference between StringBuffer and StringBuilder in java StringBuffer vs StringBuilder Parameter StringBuffer StringBuilder Thread-safe StringBuffer is thread safe. Two threads can not call methods of StringBuffer simultaneously. StringBuilder is not thread safe, so two threads can call methods of StringBuilder simultaneously. Performance It is less performance efficient as it […]
- 19 June
Can We Have Try without Catch Block in Java
In Java, it’s possible to use a try block without a catch block, but it must be followed either by a finally block or be part of a try-with-resources statement. Let’s see both cases with the help of examples: 1. try-finally Structure You can use a try block with a finally block. As you may […]
- 07 June
Daemon thread in java with example
Daemon threads are low priority background threads which provide services to user threads. It’s life depends on user threads. If no user thread is running then JVM can exit even if daemon threads are running. JVM do not wait for daemon threads to finish. Daemon threads perform background tasks such as garbage collection, finalizer etc. […]
- 03 June
How to check if String has all unique characters in java
Learn about how to check if String has all unique characters in java