A NullPointerException in Java application is best way to solve it and that is also key to write robust programs which can work smoothly. As it said “prevention is better than cure”, same is true with nasty NullPointerException. Thankfully by applyin…
This article represents top 5 coding practices related with Java exception handling that you may want to watch out for or better say, avoid, while doing coding for exception handling. Recently, I have been involved with code review of multiple Java p…
List Never swallow the exception in catch block Declare the specific checked exceptions that your method can throw Do not catch the Exception class rather catch specific sub classes Never catch Throwable class Always correctly wrap the exceptions in…
转载自https://www.baeldung.com/java-8-lambda-expressions-tips 1. Overview Now that Java 8 has reached wide usage, patterns, and best practices have begun to emerge for some of its headlining features. In this tutorial, we will take a closer look to fu…
1.Java没有sizeof关键字 , volatile是java关键字.详情见:http://www.cnblogs.com/aigongsi/archive/2012/04/01/2429166.html 2.Java的类定义可以定义一个与类名相同的方法,可以编译并执行. public class Worker extends Person{ public Worker() { System.out.println("i am worker"); } public void Wor…
001 - Java中print.printf与println的区别? printf:格式化输出,用来控制输出的格式. print:标准输出,不换行. println:标准输出,换行.例如,println("test")相当于print("test\n"). 示例: package test; public class Test { public static void main(String[] args) { System.out.print("tes…