Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-20-2008, 12:30 PM
Member
 
Join Date: Jan 2008
Posts: 2
kim85 is on a distinguished road
why doesn't this short applet work?
i was just making a simple script as a test, but it doesn't work
i know it is simple for you guys and maybe stupid but know i want to know where the problem is.
Do you know it?

public class test
{
public static void printDoubleArray()
{
int[] array1 = new int[4];

for (int i=0; 1 <4; i++)
{
array1[i] = i * 2;
}
double[] lijst = {1.4, 3.3, 6.7};

for (int i=0; i <4; i++)
{
System.out.println(i + ". (" + array1[i] + ", " + lijst[i] + ")");
}
}
}
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-20-2008, 09:43 PM
Senior Member
 
Join Date: Jul 2007
Posts: 1,022
hardwired is on a distinguished road
Code:
public class Test { public static void main(String[] args) { printDoubleArray(); } public static void printDoubleArray() { int[] array1 = new int[4]; // for (int i=0; 1 <4; i++) // typo for (int i=0; i <4; i++) { array1[i] = i * 2; } double[] lijst = {1.4, 3.3, 6.7}; for (int i=0; i <4; i++) { System.out.print(i + ". (" + array1[i]); if(i < lijst.length) System.out.print(", " + lijst[i]); System.out.print(")"); System.out.println(); } } }
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Will this applet ever work? willemjav Java Applets 4 04-20-2008 06:40 PM
Short/Integer mew New To Java 3 12-06-2007 10:28 PM
how would i get this to work...? deeadeed New To Java 6 12-06-2007 03:58 AM
Short key for getting list of opened classes in Eclipse Java Tip Java Tips 0 12-04-2007 12:11 PM
Applet, To center text and To open I engage in a dialog in an Applet Marcus Java Applets 4 06-08-2007 07:15 AM


All times are GMT +3. The time now is 10:17 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org