Skip to content

Instantly share code, notes, and snippets.

@jaspercastillo
jaspercastillo / keybase.md
Created February 16, 2021 02:50
keybase.md

Keybase proof

I hereby claim:

  • I am jaspercastillo on github.
  • I am jaspercastillo (https://keybase.io/jaspercastillo) on keybase.
  • I have a public key ASCisvrWEAdB2aNJhXxxenoKBL5b2XCSI239rDntWZS3MAo

To claim this, I am signing this object:

com.quillbytes.scratch:quillbytes-spring-boot:jar:0.0.1-SNAPSHOT
+- org.springframework.boot:spring-boot-starter-web:jar:1.1.8.RELEASE:compile
| +- org.springframework.boot:spring-boot-starter:jar:1.1.8.RELEASE:compile
| | +- org.springframework.boot:spring-boot:jar:1.1.8.RELEASE:compile
| | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.1.8.RELEASE:compile
| | +- org.springframework.boot:spring-boot-starter-logging:jar:1.1.8.RELEASE:compile
| | | +- org.slf4j:jcl-over-slf4j:jar:1.7.7:compile
| | | | \- org.slf4j:slf4j-api:jar:1.7.7:compile
| | | +- org.slf4j:jul-to-slf4j:jar:1.7.7:compile
| | | +- org.slf4j:log4j-over-slf4j:jar:1.7.7:compile
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.quillbytes.scratch</groupId>
<artifactId>quillbytes-spring-boot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
package com.quillbytes.scratch.web.controller;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@EnableAutoConfiguration
package com.quillbytes.scratch.singletons;
import static java.lang.System.out;
public class SingletonEnumTest {
// or have this in a separate file SingletonEnum.java
enum SingletonEnum {
INSTANCE;
package com.quillbytes.scratch.singletons;
import static java.lang.System.out;
public class SingletonStaticTest {
public static void main(String... args) {
Class<SingletonStatic> c = SingletonStatic.class;
//SingletonStatic x = SingletonStatic.getInstance();
out.println("end of main");
package com.quillbytes.scratch.singletons;
import static java.lang.System.out;
public class SingletonStatic {
private static final SingletonStatic INSTANCE = new SingletonStatic();
private SingletonStatic() {
out.println("SingletonStatic instantiated.");
}
package com.quillbytes.scratch.singletons;
public class SingletonSync {
private static SingletonSync INSTANCE;
private SingletonSync() { }
public static synchronized SingletonSync getInstance() {
if (INSTANCE == null) {
INSTANCE = new SingletonSync();
package com.quillbytes.scratch;
public class HelloWorld {
public static void main(String... args) {
System.out.println("Hello world!");
}
}