I use eclipse to type in the console.
Type: Posts; User: R0bsterz
I use eclipse to type in the console.
Ok, basically when i take away the "scanner1.nextLine()"
characters dont appear in the console when i type them,
If scanner1.nextLine() is added, i can type characters into the console and they...
Ok, yes i typed in the console window
and is that a yes for does scanner mean that you can type stuff?
does scanner mean that you can type stuff?
Scanner scanner1 = new Scanner (System.in);
System.out.println("Can you type?");
scanner1.nextLine() //with this i can type and characters...
but can you give me a real life example?
FIXED, thanks for your help guys =]
can u give a real life example of the scanner.nextLine() method please?
it would help me understand it :p
Hey, plz can u explain what scanner.nextLine() means...
Thanks
i know what a variable is
i don't fully know how to assign a value to a variable
i dont know how to call a method
i dont know how to assign the value that the method returns to a variable...
I really dont understand this...
Can someone just edit my code and leave comments on each line? (Im a **** noob at java)
And someMethod(); is? (what shall i enter for it?)
I dont know how to save the user input in step 1
2. Im not sure, can u tell me>?
This is what i want the program to do
1. Wait for the user input from the scanner/JOptionPane Dialogue Box
2. If the user input is the word "Sammy" then say "Hello Sammy"
3. If the user input is...
1. Well ideally, i would like to import the JOptionPane from javax.swing.JOptionPane and let the user import it from there
2. Im not sure, u can tell me what/how to do this...
No, It does not give me a box to enter the data..
--- Update ---
This is what i want the program to do:
1. Wait for the user input from the scanner
2. If the user input is the word "Sammy"...
I compile the code and my cursor says its loading... then nothing happens. (I compile + run with eclipse.)
So this is what i want my code to do:
http://i45.tinypic.com/674ec4.png
My code at the moment:
import java.util.Scanner;
class ifelse {
public static void main (String args[]) {
Scanner uinput = new Scanner (System.in);
String uinputvar =...
How do i make a new string that takes the value of the scanner "guest" and then use it with the .equals method?
1. When i ran the code in post #20 it didnt run properly -- looks like i didnt close the scanner or somthing.
2. i didnt understand post #21
3. if (name.equals(name)) {
was meant to mean: if...
Fix this code instead:
import java.util.Scanner;
class ifelse {
public static void main (String args []) {
String name = "Sammy";
Scanner guest = new Scanner (System.in);
This is my code at the moment. Sorry Norm, but I do not understand what you are saying when you are trying to help me :P, please edit my code and 'fix it' and add comments on each line so i can learn...
Sorry but i really dont understand you..
Please add what your saying to my code and i will be eternally grateful.
import java.util.Scanner;
class ifelse {
public static void main (String args []) {
String name = "Sammy";
Scanner guest = new Scanner (System.in);
System.out.println("Hello, What...