The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes last println doesn't print anything Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "last println doesn Watch "last println doesn New topic

last println doesn't print anything

carlos olmos

Joined: May 28, 2003
Posts: 12
Running some experiments I ended up with this code:
public class CertPrep extends Object {
static byte a;
static short b;
static char c;
static int d;
static long e;
static String s;
public static void main(String[] args) {
A a1 = new A();
A ab = new B();
B b1 = new B();
String aa = "String";
int bb = 3;
int cc= 7;
System.out.println(aa + bb + cc);
Why the last println System.out.println(aa + bb + cc);
prints a blank line?
I'm using java 1.3.1
Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1090
Hi Carlos
I don't know about 1.3 but in 1.4 it prints the last line as well. But I don't see any reason why the last line should not be printed in JDK 1.3 or for that matter any version till date.
[ May 30, 2003: Message edited by: Anupam Sinha ]
John Lee
Ranch Hand

Joined: Aug 05, 2001
Posts: 2545
maybe the best way is to write a program.
I agree. Here's the link:
subject: last println doesn't print anything
It's not a secret anymore!