This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

last println doesn't print anything  RSS feed

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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(a+b+c+d+e+s);
System.out.println(s+a+b+c+d+e);
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
Regards.
Carlos.
 
Ranch Hand
Posts: 1090
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe the best way is to write a program.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!