Tag Archives: java

java tutorial: java enum in switch case

Java enum in switch case : 1. Returns the enum constant of the specified enum type with the specified name. 2. The case label is an enum constant. Continue reading

Posted in Internet Technology | Tagged , , , | Comments Off on java tutorial: java enum in switch case

java tutorial: java get timestamp milliseconds

Java get timestamp milliseconds : 1.System.currentTimeMillis(); 2.Calendar.getInstance().getTimeInMillis(); 3.new Date().getTime(); Continue reading

Posted in Internet Technology | Tagged , , | Comments Off on java tutorial: java get timestamp milliseconds

java tutorial: Java enum check if value exists

Java enum check if value exists: 1. Enum class provides inspection methods 2. Check with for loop 3.Use stream iterators 4.Use a tool class similar to Apache EnumUtils Continue reading

Posted in Internet Technology | Tagged , , | Comments Off on java tutorial: Java enum check if value exists

java tutorial: Java Generic

Java generics, in a nutshell, generics enable types (classes and interfaces) to be parameters when defining classes, interfaces and methods. Continue reading

Posted in Internet Technology | Tagged , , | Comments Off on java tutorial: Java Generic

java tutorial: 5 ways to create stream in java 8

A java stream is a sequence of objects, which can be arranged, filtered, and transformed through a pipeline to produce the desired result. Continue reading

Posted in Internet Technology | Tagged , , | Comments Off on java tutorial: 5 ways to create stream in java 8

java tutorial: Java exception

A java exception is an event that occurs during the execution of a java program that disrupts the normal flow of instructions. Continue reading

Posted in Internet Technology | Tagged , , | Comments Off on java tutorial: Java exception

java tutorial: java 8 Lambda built-in functional interfaces

Java 8 functional interface: Function : R apply(T t), Supplier : T get() , Predicate : boolean test(T t) , Consumer : void accept(T t) Continue reading

Posted in Internet Technology | Tagged , | Comments Off on java tutorial: java 8 Lambda built-in functional interfaces

IntelliJ IDEA utility plugin

IntelliJ IDEA is an excellent Java IDE, with the help of excellent IDEA plugins, we can greatly improve efficiency in daily development. Continue reading

Posted in Internet Technology | Tagged , , , | Comments Off on IntelliJ IDEA utility plugin

java tutorial: three ways to generate random numbers in Java

Java random number have three ways: java.lang.Math.Random, java.util.Random, java.util.concurrent.ThreadLocalRandom Continue reading

Posted in Internet Technology | Tagged | Comments Off on java tutorial: three ways to generate random numbers in Java

java tutorial: java 8 lambda expression example

Lambda expressions are a simplification of anonymous inner classes, a functional programming idea that makes code look cleaner. Continue reading

Posted in Internet Technology | Tagged , , | Comments Off on java tutorial: java 8 lambda expression example

java tutorial: install Java JDK and Maven on Mac

Install Java JDK and Maven on mac os: 1) Download and install files from the official website; 2) Install using homebrew package manager. Continue reading

Posted in Internet Technology | Tagged , | Comments Off on java tutorial: install Java JDK and Maven on Mac

Basic design structure of java

Java is case sensitive; The main method must be declared public, and each application has one and only one main method; General syntax used by java: object.method(parameters) Java programs comments Single-Line Comment: // Multiline Comment: /* */ Java data type … Continue reading

Posted in Internet Technology | Tagged , | Comments Off on Basic design structure of java