![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 214
Rep Power: 0
![]() |
Your solution Arevos worked ... and for that I would like to give you a kiss. However, since I'm not gay I will just say thank you and have a nice day.
Also thank you everyone else who has put time into this.
__________________
Death smiles at us all. All a man can do is smile back. |
|
|
|
|
|
#12 |
|
Expert Programmer
|
I would be more than happy if someone could explain to me why that code compiles under Java 5. According to Sun's documentation, the following is the correct way to call printf:
Object[] args = { new String("Java is object oriented.") };
System.out.printf("|%s|%n", args); |
|
|
|
|
|
#13 | ||
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
![]() Quote:
public PrintWriter printf(String format, Object... args) System.out.printf("%s %s", new Object[] { "Hello", "World" });System.out.printf("%s %s", "Hello", "World");Also, this type of string creation: new String("Java is object oriented.") |
||
|
|
|
|
|
#14 |
|
Expert Programmer
|
Thanks for the explanation, Arevos. I had never heard of varargs before (in Java, that is).
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 500 Ways to Program Numbers 1 Through 10! | Sane | Coder's Corner Lounge | 637 | Jan 5th, 2008 11:15 PM |
| Custom Hashing Algorithms | Sane | C | 21 | Oct 16th, 2006 10:05 PM |
| complete newbie question | melee28 | C | 36 | Sep 11th, 2005 7:48 AM |
| problem with this calculator program | designXperts.net | Java | 2 | May 23rd, 2005 7:14 AM |