AkiVaMu Just tiny things come to mind...

Posts related to JAVA


First .NET Core application

Create app

more...

From Java world to .NET world

Overview

more...

JAVA multi threading

synchronized keyword

more...

JAVA Static Code Analysis

This points out the differences among some tools:

more...

jCenter vs Maven Central

This is an awesome article. Here is the summary:

  • jCenter and Maven Central are both Maven Repository
  • jCenter is hosted by bintray.com. Maven Central is hosted by sonatype.org.
  • Other can also host their own Maven Repo servers.
  • Should publish your library to standard server (e.g. jCenter and Maven Central…)
  • Maven Central is harder to publish to.
  • jCenter pros:
    • Use CDN
    • The largest Java Repository
    • Easy to publish library
more...

Java nested class

Definition

Nested class is declaring a class inside another class. There are 2 types:

  • Static nested class
  • Non-static nested class, divided into 3 types:
    • Inner class
    • Method local inner class
    • Anonymous
more...

Java varargs

Definition

This code declare a function that can take arbitrary number of parameters. The parameters must be the same type int.

void sampleFunction(int... args) {
    System.out.print(args.length);
    
    for (int i = 0; i < args.length; i++) {
        System.out.print(args[i]);
    }
}

It’s possible to mix varargs with other parameter types, like this:

void sampleMixingFunction(String name, Date date, int... args) {
    ...
}

The varargs must be the last parameters in function signature.
It’s not allowed to declare multiple varargs in one function.

more...

First-class function in JavaScript and Java

What is first-class function?

  • Can be named by variables.
  • Can be passed as arguments to procedures.
  • Can be returned as the results of procedures.
  • Can be included in data structures.
more...

Java HashMap principle

Been learning Java for a while and using HashMap many times, but today I read an article about HashMap’s buckets length and think I should dig deeper to understand it. This article is to summarize about HashMap, and how it works internally.

more...

When and why use Java @Override annotation

When should we use @Override annotation

more...