imsavva.com

Folder icon

Tags / interview questions

1Z0-808
2018
ATG
Apache Fop
Bash
CNC
Elasticsearch
GWT
Groovy
JPA
Java
JavaScript
Jenkins
Jetty
Kibana
Linux
Malta
MySQL
OCA
PDF
Sed
Ubuntu
Windows services
collections
concurrency
dates
dig deeper
essay
exceptions
food
games
interview questions
logging
movies
patterns
photos
shopping
task
technical
thoughts
trash
trip
windows
1
2

Can I use try-finally block (without catch)?

showPostImage(597176531)

Uncaught exception: the image was stolen by a UFO

Yes, you can use the try-finally construction. As a use case, we can try to connect to a database and finally we will close the connection: This code looks a bit redundant. But in Java 7 we can use a try-with-resources block to handle our resources closing in a more convinient way... In Java 7 we can use a try-with…
Posted on
2016-03-19

Describing the Java Deque collection interface

A Deque is a double-ended-queue. It is a collection of elements that supports the insertion and removal of elements at both end points. It implements both Stack and Queue at the same time. This interface defines following methods: void addFirst(E e) void addLast(E e) boolean offerFirst(E e) boolean offerLast(E e) E…
Posted on
2016-03-19

Describing the Java List collection interface

showPostImage(575624130)

Uncaught exception: the image was stolen by a UFO

List is an ordered collection that can contain duplicates. In addition to the Collection interface methods, the List interface includes the following: Positional access: manipulating the elements by their index in the list. This includes methods such as: get, set, add, addAll, remove. Search: methods indexOf and…
Posted on
2016-03-19

Describing the Java Map collection. Difference between other collections.

showPostImage(564019001)

Uncaught exception: the image is currently being shown in a museum

Map is a collection that stores key-value pairs. A map cannot contain duplicate keys. What is the main difference between Map and other collections? The main difference between Map and other collections is that it contains key and value. It doesn’t inherit from Collection interface. The Map interface includes methods…
Posted on
2016-03-19

Describing the Java Set collection interface

showPostImage(300406476)

Uncaught exception: the image was stolen by a UFO

A Set is a Collection that cannot contain duplicates. The Set interface extends Collection interface but has no specific methods. It adds the restriction that duplicates are prohibited. This interface also adds a stronger contract on the behavior of the equals and the hashcode methods, allowing Set instances to be…
Posted on
2016-03-19

Java Collections hierarchy

(Self-explanatory image above)
Posted on
2016-03-19

Java exceptions handling order

showPostImage(-1069492847)

Uncaught exception: the image is currently being shown in a museum

Consider there is a method which can throw IOException and FileNotFoundException. Is there a difference in which order we catch these exceptions in a single try-catch block? Will this code work correctly? The answer is NO. If you handle IOException first, you will never reach FileNotFoundException handling block…
Posted on
2016-03-19
1
2
Do I really need the footer?