Welcome, Guest. Please login or register.
Did you miss your activation email?
Pages: [1]   Go Down
  Print  
Author Topic: Java stars for loop  (Read 4144 times)
0 Members and 1 Guest are viewing this topic.
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« on: February 15, 2008, 01:34:12 PM »

Code
GeSHi (java):
  1. /*--------------------------------------------------------------------------
  2. // Author List:
  3. //      deAppel <Creator>
  4. //
  5. // Description:
  6. // Do it yourself ;)
  7. //
  8. // Environment:
  9. //      This software was developed using Eclipse and Java 1.6
  10. //
  11. // Copyright Information:
  12. //      Copyright (C) 2007      <Institution><None>
  13. // Ark de Appel www.engineeringserver.com
  14. //
  15. //----------------------------------------------------------------------*/
  16. public class CLIStars {
  17. public static void main(String[] args){
  18. int row = 9;
  19. String text = "*";
  20. String textReverse = "*";
  21.  
  22. for (int i=0; i < row; i++){
  23. System.out.println(text);
  24. text = text + "*";
  25. }
  26.  
  27. for (int y=1; y<=row; y++){
  28. for(int j=1; j<=row-y; j++)
  29. System.out.print(textReverse);
  30. System.out.println();
  31.  
  32. }
  33. }
  34. }
Created by GeSHI 1.0.7.20
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
BlueEew
Member
*

Reputation: 0
Offline Offline
Gender: Male
Posts: 100
Referrals: 0

Awards
« Reply #1 on: February 29, 2008, 07:07:12 PM »

So in Java.  This code would be used to loop something?  The star is the symbol that tells something to loop.  Maybe you can explain this before.  I want to learn the general basics of java.
Logged

Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« Reply #2 on: February 29, 2008, 08:45:52 PM »

The code prints out a number of stars and in reverse. Something like:

*
**
***
**
*
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
BlueEew
Member
*

Reputation: 0
Offline Offline
Gender: Male
Posts: 100
Referrals: 0

Awards
« Reply #3 on: March 01, 2008, 01:46:42 PM »

It seems all confusing to me.  Is Java hard to understand?  I am intrested in creating Java games in the future.  However I need to know how difficult it is.
Logged

JorycapyPoece
Junior Member
*

Reputation: 0
Offline Offline
Posts: 2
Referrals: 0

Awards
« Reply #4 on: March 12, 2008, 05:16:33 PM »

Hello everybody,
So, let's chat! What's going on?
 
 
------------------
insurance
Logged
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« Reply #5 on: March 13, 2008, 05:19:10 AM »

Hello everybody,
So, let's chat! What's going on?
 
 
------------------
insurance

For general discussions go here: http://www.engineeringser...eneral+discussions-b17.0/
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
SwiftPost
Member
*

Reputation: 0
Offline Offline
Posts: 60
Referrals: 0

Awards
« Reply #6 on: March 17, 2008, 07:09:16 PM »

It seems all confusing to me.  Is Java hard to understand?  I am intrested in creating Java games in the future.  However I need to know how difficult it is.

I am also confused by Java.  I am new ro Java and I am looking at codes and tutorials to get a feeling what dose what.  I would love to properly learn Java. :)
Logged
BlueEew
Member
*

Reputation: 0
Offline Offline
Gender: Male
Posts: 100
Referrals: 0

Awards
« Reply #7 on: March 19, 2008, 10:53:38 AM »

Good to hear you are here to learn.  I would also like to learn Java.  I am starting with the basics and I will go from there.  I would like to make games using Java.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here