The Artima Developer Community
Sponsored Link

Java Answers Forum
Whats wrong?

2 replies on 1 page. Most recent reply: Apr 30, 2004 12:45 PM by Matt Gerrans

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Hussain

Posts: 2
Nickname: saino
Registered: Apr, 2004

Whats wrong? Posted: Apr 30, 2004 12:04 PM
Reply to this message Reply
Advertisement
when i try and post code up here it just does it all on one line even tho i used the
 
thing


Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Whats wrong? Posted: Apr 30, 2004 12:30 PM
Reply to this message Reply
> when i try and post code up here it just does it all on
> one line even tho i used the (pre tags) thing.

Don't use the pre tags, use the java tags and the code will look much nicer.

Also, if it came out in one long line, that may have something to do with how it originally was or how it was pasted...

Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Whats wrong? Posted: Apr 30, 2004 12:45 PM
Reply to this message Reply
Here's an example. You can see what the original looked like (sort of, without the > prefixes on each line), but replying and then using the "Quote Original" button -- that will paste the unformated text into your reply.

/**
 * LovelyFormattedJavaCodeSample -- does nearly nothing, but it sure is purty!
 */
class LovelyFormattedJavaCodeSample
{
   private String name;
 
   public LovelyFormattedJavaCodeSample( String name )
   {
      this.name = name;
   }
 
   public String getName()
   {
      return name;
   }
 
   // Just to how how a "for" and quoted strings look:
   public String sayHello( int howManyTimes )
   {
      for( int i = 0; i < howManyTimes; i++ )
         System.out.printnl( "Hello from " + name + "!" );
   }
 
   // ...
}

Flat View: This topic has 2 replies on 1 page
Topic: Open new frame with delay Previous Topic   Next Topic Topic: Help me

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use