conditional statement help!

i need to create an IF statement for a part of my code.

I dont know what can use in the brackets to check if my 'refNumber' field has a value. What i need is to create an IF statement that prints out the details and if it doesnt have a ref number then it will print "ZZZ" for the ref number field.

thnx

publicvoid printDetails()

{

if()

{

System.out.println ("Title: " + title +",");

System.out.println ("Author: " + author +",");

System.out.println ("Pages: " + pages +",");

System.out.println ("Reference Number: " + refNumber +",");

}

[993 byte] By [cyrus666a] at [2007-10-3 8:29:39]
# 1

I'm not entirely certain this is what you mean, but...if(refNumber == null || refNumber.equals("")) {

refNumber = "ZZZ";

}

followed by the statements you already have now.

Herko_ter_Horsta at 2007-7-15 3:36:34 > top of Java-index,Java Essentials,New To Java...