Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
What is NullPointerException and how to handle it?
What is NullPointerException and how to handle it?
✍: Guest
When an object is not initialized, the default value is null. When the following things happen, the NullPointerException is thrown:
--Calling the instance method of a null object.
--Accessing or modifying the field of a null object.
--Taking the length of a null as if it were an array.
--Accessing or modifying the slots of null as if it were an array.
--Throwing null as if it were a Throwable value.
The NullPointerException is a runtime exception. The best practice is to catch such exception even if it is not required by language design.
2012-05-17, 2352👍, 0💬
Popular Posts:
When does the compiler not implicitly generate the address of the first element of an array? Wheneve...
What are the different storage classes in C? C has three types of storage: automatic, static and all...
What Happens to Indexes If You Drop a Table? - Oracle DBA FAQ - Managing Oracle Table Indexes If you...
How To Calculate Expressions with SQL Statements? - MySQL FAQs - Introduction to SQL Basics There is...
What would you use to compare two String variables - the operator == or the method equals()? You can...