A: 创造性模式 1. 工厂方法模式(FactoryMethod) 1.1 类图 1.2 代码1 public interface Pet { public String petSound(); } public class Cat implements Pet { @Override public String petSound() { return "Meaw Meaw..."; } } public class Dog implements Pet { @Override pub…
Understanding how Java code is compiled into byte code and executed on a Java Virtual Machine (JVM) is critical because it helps you understand what is happening as your program executes. This understanding not only ensures that language features mak…
[转]Java Code Examples for android.util.JsonReader The following are top voted examples for showing how to use android.util.JsonReader. These examples are extracted from open source projects. You can vote up the examples you like and your votes will b…
Elasticsearch虽然定位为Search Engine,但是因其可以持久化数据,很多时候,我们把Elasticsearch当成Database用,但是Elasticsearch不支持SQL,就需要把SQL逻辑转换成代码实现对应的功能. 以下列举了一些常用的SQL转换成对应的Java代码. 1.按某个field group by查询count SELECT fieldA, COUNT(fieldA) from table WHERE fieldC = "hoge" AND fie…
In order to make the codes looks unified and make it easy to understand, it's better to use the same formatter for our code, the xml is the standard formatter, you can apply it to your STS. open STS -> Window -> type “formatter” -> choose Java -…
google-java-format plugin should intercept the “Reformat Code” action in IDEA (Ctrl+Alt+L) and apply its own rules. However, it does not work with imports for some reason, so to fix that you have to import a Java Google Code Style XML file to your c…
http://kalali.me/manage-administrate-and-monitor-glassfish-v3-from-java-code-using-amx-jmx/ Manage, Administrate and Monitor GlassFish v3 from Java code usingAMX & JMX 0 inShare Digg Digg Management is one of the most crucialparts of an application s…
With the help of LiJun I got a piece of JAVA code. With this code, I can do below things like connect to oracle database with jdbc driver and run sql. Below are the Java code. import java.sql.Connection; import java.sql.DriverManager; import java.sql…
UML diagrams compliment inline documentation ( javadoc ) and allow to better explore / understand a design. Moreover, you can print and bring them to table to discuss a design. In this post, we will install and use the ObjectAid plugin for Eclipse to…