Java Primitives versus Objects (#4946)

* Add code for the article 'Java Primitives versus Objects'

* Use JMH for benchmarking the primitive and wrapper classes

* Uncomment the benchmarks and remove unused class

* Add Long/long to the benchmark

* Remove assertions from the benchmarks

* Add the java docs
This commit is contained in:
Andrey Shcherbakov
2018-08-26 20:45:37 +02:00
committed by Grzegorz Piwowarek
parent d2e6a740df
commit 89e8d66def
33 changed files with 841 additions and 0 deletions
@@ -0,0 +1,13 @@
*.class
#folders#
/target
/neoDb*
/data
/src/main/webapp/WEB-INF/classes
*/META-INF/*
# Packaged files #
*.jar
*.war
*.ear
@@ -0,0 +1,2 @@
### Relevant Articles:
- [SHA-256 Hashing in Java](http://www.baeldung.com/sha-256-hashing-java)
@@ -0,0 +1,2 @@
### Relevant Articles:
- [A Guide to Java Enums](http://www.baeldung.com/a-guide-to-java-enums)
@@ -0,0 +1,5 @@
### Relevant Articles:
- [A Guide To UDP In Java](http://www.baeldung.com/udp-in-java)
- [A Guide To HTTP Cookies In Java](http://www.baeldung.com/cookies-java)
- [A Guide to the Java URL](http://www.baeldung.com/java-url)
- [Working with Network Interfaces in Java](http://www.baeldung.com/java-network-interfaces)
@@ -0,0 +1 @@
Premain-class: com.baeldung.objectsize.InstrumentationAgent
@@ -0,0 +1,2 @@
### Relevant Articles:
- [How to Print Screen in Java](http://www.baeldung.com/print-screen-in-java)
+2
View File
@@ -0,0 +1,2 @@
-d javac-target -verbose
com/baeldung/javac/Data.java
+2
View File
@@ -0,0 +1,2 @@
-d javac-target
-verbose
+1
View File
@@ -0,0 +1 @@
com/baeldung/javac/Data.java
+3
View File
@@ -0,0 +1,3 @@
-d javac-target
-Xlint:rawtypes,unchecked,static,cast,serial,fallthrough
com/baeldung/javac/Data.java
+9
View File
@@ -0,0 +1,9 @@
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
@@ -0,0 +1,2 @@
### Relevant Articles:
- [Introduction to the Java 8 Date/Time API](http://www.baeldung.com/java-8-date-time-intro)
@@ -0,0 +1,2 @@
### Relevant Articles:
- [Convert Hex to ASCII in Java](http://www.baeldung.com/java-convert-hex-to-ascii)
@@ -0,0 +1,2 @@
Relevant Articles:
- [Java String Conversions](http://www.baeldung.com/java-string-conversions)
Binary file not shown.