<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Green__Hand__的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/Green__Hand__</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; Green__Hand__]]></copyright><item><title><![CDATA[单例模式返回值为空（空指针异常）]]></title><link>https://blog.youkuaiyun.com/Green__Hand__/article/details/103625076</link><guid>https://blog.youkuaiyun.com/Green__Hand__/article/details/103625076</guid><author>Green__Hand__</author><pubDate>Thu, 19 Dec 2019 23:20:47 +0800</pubDate><description><![CDATA[单例模式返回值为空（空指针异常）空指针异常
空指针异常
今天使用单例模式返回一个 Statement对象 的时候，发现总是报空指针异常，经过我仔细检查，发现是对 Statement变量 的定义写在了类实例化语句的后面！当类实例化的时候，不能把目标对象的引用正确赋值给我声明的变量。我把变量声明写在实例化之前，再运行：NullPointerException——解决了！

...]]></description><category></category></item></channel></rss>