Interfaces in Golang
Interfaces are collections of method signatures. A interface type can hold any value that implements those methods. The empty interface is an interface type that specifies zero methods. A type assertion provides access to an interface underlying concrete value. Two interfaces are equal if they have equal concrete values and identical dynamic types, or if both are nil.
All keywords in Java
Keywords are special words in the programing language which have reserved use in the language. Keywords may not be used as identifiers in Java; for example you cannot declare a field whose name is a keyword.
How to generate a random int in Golang
In Golang there a are two libraries for generating random integers, one is a pseudo-random number generator (package math/rand
) and the second one is cryptographically secure random number generator (package crypto/rand
)
How to split a string into slice in Golang
How to split a string into slice using Golang. For a simple split by a singular character you can use Split()
method from strings
package. For more complex rules the regexp.Split()
method can be used.
Java Custom Annotations Example
How to create Java Custom Annotation. A simple example of creating Annotations in Java and usage by calling the Reflection API.
How to generate UUID / GUID in Java
How to generate UUID / GUID in Java using java.util.UUID
class, UUID.randomUUID()
method.