Joke Collection Website - Public benefit messages - What does java.lang.NullPointerException mean?
What does java.lang.NullPointerException mean?
java.lang.NullPointerException specifically means a null pointer exception. The most common problem is that there is no initialization.
In Java, the reasons for null pointer exceptions are generally as follows:?
1. String variables are not initialized;?
2. Interface type The object is not initialized with a specific class, for example:?
List lt; will report an error?
List lt = new ArrayList(); will no error be reported?
3. When the value of an object is empty, there is no judgment of being empty. You can try adding a line of code before the following code:?
if(rb!=null && rb!="")?
Change it to:?
< p>if(rb==null);?if(rb!==null&&rb!="") or if(("").equals(rb))?
Extended information:
java.lang includes the basic Object class, Class class, String class, basic types of packaging classes, basic mathematics classes and other basic classes.
Class Math provides commonly used mathematical functions such as sine, cosine, and square root. Similarly, classes String and StringBuffer provide common string operations.
Classes ClassLoader, Process, Runtime, SecurityManager and System provide "system operations" such as dynamic loading of management classes, external process creation, host environment query (such as time) and security policy implementation.
Class Throwable contains objects that may be thrown by the throw statement (§14.16). Subclasses of Throwable represent errors and exceptions.
- Previous article:What should I do if my friends in my mobile phone watch disturb my homework?
- Next article:Short message inquiry of CCB card balance
- Related articles
- Qq duanzi daquan
- How to check the password of mobile service and send SMS?
- How to split Apple's mobile phone WeChat?
- Does the segment beginning with 134 belong to mobile, China Unicom or telecom?
- If your credit card expires, will you send me a message?
- How does China Mobile unsubscribe from the package?
- New Year’s greetings to the elders
- Why can't the mobile phone receive the verification code in 12306?
- How to set up authentication for a router?
- How to open Weibo members through SMS?