Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Visual J# / August 2005

Tip: Looking for answers? Try searching our database.

What format?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
c8prog - 24 Aug 2005 03:58 GMT
import System.*;

class Format
{
 public static void main(String[] args)
 {
   Console.WriteLine("{0,5},{1,-5}","10","10");
 }
}

Above program is good result like C#.(   10,10   )

But if I write 'Console.WriteLine("{0,5},{1,-5}",10,10);'
Console.WriteLine not support (string,int,int) <= error message

How use Console.WriteLine??

Thank you.
David Anton - 24 Aug 2005 15:51 GMT
You have to cast the int's to an object-derived .NET type.  This is easily
one of the most annoying things about J# - but primitive types such as "int"
do not work seamlessly with their .NET counterparts such as an "Int32".
e.g.,
Console.WriteLine("{0,5}, {1,-5}", (Int32)10, (Int32)10);

Just as annoying is that although you have to jump through hoops to get .NET
methods to receive primitive types, the same .NET methods return primitive
types, so their results *can't* be assigned to a .NET type.  Go figure...
Signature

David Anton
www.tangiblesoftwaresolutions.com
Home of:
Clear VB: Cleans up outdated VB.NET code
Instant C#: Converts from VB.NET to C#
Instant VB: Converts from C# to VB.NET
Instant J#: Converts from VB.NET to J#

> import System.*;
>
[quoted text clipped - 14 lines]
>
> Thank you.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.