Results 1 to 3 of 3
- 05-16-2010, 03:30 AM #1
Member
- Join Date
- May 2010
- Posts
- 1
- Rep Power
- 0
- 05-16-2010, 05:27 AM #2
Senior Member
- Join Date
- Dec 2008
- Posts
- 526
- Rep Power
- 0
well I can recommend read sun tutorials first and get some books. Just google it
it is called initialize variables ;)i,m very new to java how read values into variables
int a=10; Something like that or String a="10";If my answer helped you. Please click my "REP" button and add a comment
Have a Good Java Coding :)
- 05-16-2010, 05:48 AM #3
Member
- Join Date
- May 2010
- Posts
- 27
- Rep Power
- 0
Do you mean reading variables from the consol?
First, you need to add to the header (very very top, even above public class):then, in your main, addJava Code:import java.util.Scanner;
to read variable input from the consol, follow this example:Java Code:Scanner input = new Scanner(System.in);
to change the type of thing to read use next() for strings and nextFloat() for floats (be sure to change the variable type as well!)Java Code:int a = input.nextInt()
Similar Threads
-
Problem while saving values into variables in a Wizard Page
By zangopango in forum EclipseReplies: 1Last Post: 03-08-2010, 06:25 PM -
Mapping of variables to values (permutation with repetition?)
By electra in forum Advanced JavaReplies: 3Last Post: 08-24-2009, 07:39 PM -
Help in reading values from html form in java
By ichkoguy in forum Advanced JavaReplies: 7Last Post: 03-16-2009, 07:45 AM -
[SOLVED] Debug: values not shown for variables
By jwilley44 in forum EclipseReplies: 7Last Post: 01-30-2009, 03:33 AM -
how to have function variables remember their values between calls
By asterik123 in forum New To JavaReplies: 2Last Post: 08-03-2007, 04:06 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks