Post: Java Programming Looping
03-12-2011, 09:46 PM #1
IKILLU2014
Toaster...
(adsbygoogle = window.adsbygoogle || []).push({}); So i am just starting to learn java, and i made a pretty good calculator all by myself with no tuts, just the code and the definition of what it does, but i cannot figure out how to make it look to the beginning after i am finished, so i do not have to restart it each time. Does anyone know?
(adsbygoogle = window.adsbygoogle || []).push({});
03-12-2011, 09:48 PM #2
Originally posted by IKILLU2014 View Post
So i am just starting to learn java, and i made a pretty good calculator all by myself with no tuts, just the code and the definition of what it does, but i cannot figure out how to make it look to the beginning after i am finished, so i do not have to restart it each time. Does anyone know?


Why don't you learn Java first before making a Java application? O_o

The following 2 users say thank you to TheUberFail for this useful post:

kiwimoosical, Ritztro
03-12-2011, 09:49 PM #3
IKILLU2014
Toaster...
Originally posted by TheUberFail View Post
Why don't you learn Java first before making a Java application? O_o

Im better at learning by experience and everything in it works, i just cannot make it loop
03-12-2011, 09:58 PM #4
kiwimoosical
Bounty hunter
Use something like a while loop:
    String marker = "";
while(!marker.equalsIgnoreCase("quit"))
{
//your codecode
marker = new java.util.Scanner(System.in).nextLine();
}

The following user thanked kiwimoosical for this useful post:

IKILLU2014
03-13-2011, 04:15 AM #5
IKILLU2014
Toaster...
I got it to work i was misusing while loop.
03-13-2011, 02:33 PM #6
kiwimoosical
Bounty hunter
Originally posted by TheUberFail View Post
Why don't you learn Java first before making a Java application? O_o


He's learning java right now. It's a simple program what he is doing. He isn't like writing a game :P
03-13-2011, 05:08 PM #7
Originally posted by kiwimoosical View Post
He's learning java right now. It's a simple program what he is doing. He isn't like writing a game :P


/facepalm i thought he said he was trying to write java without reading java tutorials, but he ment tutorials on the calculator, my bad xD
03-13-2011, 05:41 PM #8
kiwimoosical
Bounty hunter
Originally posted by TheUberFail View Post
/facepalm i thought he said he was trying to write java without reading java tutorials, but he ment tutorials on the calculator, my bad xD


It's all good xP
03-15-2011, 03:36 AM #9
DeLeTeD
Maggbot timeout!
Originally posted by kiwimoosical View Post
Use something like a while loop:
    String marker = "";
while(!marker.equalsIgnoreCase("quit"))
{
//your codecode
marker = new java.util.Scanner(System.in).nextLine();
}



right and wrong. If your using a loop like his case you want it to run at least once do a do while is better for loading. I know the difference is not much and your method still works however getting use to the proper format and use of codes will help in the long run.
03-15-2011, 03:44 AM #10
IKILLU2014
Toaster...
Originally posted by DeLeTeD View Post
right and wrong. If your using a loop like his case you want it to run at least once do a do while is better for loading. I know the difference is not much and your method still works however getting use to the proper format and use of codes will help in the long run.


I did it an easy way. I just put

int repeat;

repeat++;

do{
..........

}while(repeat<=3);


Its somthing like that i cant remember everything i put.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo