dynamic initialization in java
------------------------------
we use a class Scanner available in java.util.* to initialize values dynamically from keyboard.
Method summary
--------------
byte--nextByte()
short-nextShort()
int --nextInt()
long--nextLong()
float-nextFloat()
double-nextDouble()
boolean-nextBoolean()
String-next()
-nextLine()
ex:
Scanner s=new Scanner(System.in);
int a=s.nextInt();
------------------------------
we use a class Scanner available in java.util.* to initialize values dynamically from keyboard.
Method summary
--------------
byte--nextByte()
short-nextShort()
int --nextInt()
long--nextLong()
float-nextFloat()
double-nextDouble()
boolean-nextBoolean()
String-next()
-nextLine()
ex:
Scanner s=new Scanner(System.in);
int a=s.nextInt();
No comments:
Post a Comment