db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendle...@amberpoint.com>
Subject Re: Returning NULL from a database-side Java function
Date Tue, 09 Oct 2007 17:13:29 GMT
>>> 1. Why does int pop = 0 == 0 ? 1 : null; even compile?

For what it's worth, it doesn't compile for me:

C:\bryan\src\java\pop>java -version
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

C:\bryan\src\java\pop>type pop.java
class pop
{
     void x()
     {
         int pop = 0 == 0 ? 1 : null;
     }
}

C:\bryan\src\java\pop>javac pop.java
pop.java:5: incompatible types
found   : <nulltype>
required: int
         int pop = 0 == 0 ? 1 : null;
                                ^
1 error

thanks,

bryan


Mime
View raw message