imsavva.com

Folder icon

Coding

1Z0-808
ATG
Apache Fop
Elasticsearch
GWT
Groovy
JPA
Java
JavaScript
Jetty
Kibana
OCA
PDF
collections
concurrency
dates
dig deeper
exceptions
games
interview questions
logging
patterns
task
1
2
3
4
5
6

Whas is a collection?

showPostImage(-1803150519)

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

Collection is an object that groups multiple elements into a single unit. Collections are used to store, retrieve and manipulate data. Live example: several Employee objects can be grouped into a collection: Java has a Java Collection Framework (JCF), which consists of: Interfaces - these are abstract data types that…
Posted on
2016-03-19

What benefits does JCF provide?

showPostImage(-1054418192)

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

Java Collections Framework provides the following benefits: Reduces programming effort: you don’t need to invent the wheel anymore, JCF provides useful data structures and algorithms. Increases program speed and quality: JCF provides high-performance, high-quality implementations of useful data structures and…
Posted on
2016-03-19

What is a diamond operator?

This is an improvement appeared in Java 7. Consider you have a class with a long name and you need to create a HashMap of Strings and Lists of your class instances. You code will look like this: In Java 7 you can write less code using the diamond operator(< > ):
Posted on
2016-03-19

What data can be stored in a collection?

showPostImage(436047025)

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

You can store anything but primitives. To store primitives consider using wrappers (Integer for int, Double for double, etc…). For example, you can store your own classes: To store primitives: Notice, that you can add primitives, since it will be wrapped automatically:
Posted on
2016-03-19

What methods does Java Collection interface contain?

showPostImage(890699667)

Uncaught exception: the image was stolen by a UFO

int size(); boolean isEmpty(); boolean contains(Object o); Iterator iterator(); Object [ ] toArray(); T [ ] toArray(T [ ] a); boolean add(E e); boolean remove(Object o); boolean containsAll(Collection<?> c); boolean addAll(Collection<? extends E> c); boolean removeAll(Collection<?> c); boolean retainAll(Collection…
Posted on
2016-03-19

JavaScript scope mini-task

What we will see in the console? The result will be: In the outer function this refers to the object, because the outer func is invoked as a method. But the inner function is invoked as a usual function, and hence this refers to window object. However, the inner function still can see its parent's scope, that's…
Posted on
2016-02-19

Some daily news

There are some interesting things in my life today. I started learning English again, and I finished one of my interesting tasks. Today, 14 June 2015, I started learning English at the office, where I'm studying Java. I have lessons every Tuesday and Thursday. Also I'm going to continue taking personal lessons in my…
Posted on
2015-07-14
1
2
3
4
5
6
Do I really need the footer?