java compilation error

Ads
 

java compilation error

View Answers

October 20, 2008 at 4:49 PM

Hi dharani,



This is running code. I hope that this code will help you.


import java.util.*;
import java.util.Scanner;

public class LocalVariableDemo{
public static void main(String[] args) {
String name;
int age;
System.out.println("Please enter name or age!");
Scanner in = new Scanner(System.in);
// Reads a single line from the console
// and stores into name variable
name = in.nextLine();
// Reads a integer from the console
// and stores into age variable
age=in.nextInt();
in.close();
// Prints name and age to the console
System.out.println("Name :"+name);
System.out.println("Age :"+age);

}
}

---------------------------------------------------
Read for more information.

http://www.roseindia.net/java/

Thanks.

Ads









Related Tutorials/Questions & Answers:
Java compilation error - Java Beginners
Java compilation error  Method overridden problems in compile time error
compilation error - Java Beginners
compilation error  class s { public static... this program it is giving an error as integer number is too large.why? and what is the reason?  Hi Friend, In Java there are some specific literal
Advertisements
java compilation error - Hibernate
java compilation error  hi, i have made an registration page whosevalues should be inserted into database. i have used hibernate and eclipse it is working fine. but when i make a war file and deploy it using ant and then run
java compilation error - Java Beginners
java compilation error  i have downloaded java software(version 6... command, error message is displayed javac is not recognized as an internal... from where i should download java or what to do now?  Have you set
Java Compilation error. Hibernate code problem. Struts first example - Hibernate
Java Compilation error. Hibernate code problem. Struts first example  Java Compilation error. Hibernate code problem. Struts first example
compilation error
compilation error  Hi my program below is not compiling,when I try to compile it i'm getting the error message "tool completed with exit code 1".The loop has to be at the end of the program can you help me. Blockquoteimport
java Compilation
java program compilation time following error is occur in my system Note...java Compilation  import java .util.*; class ArrayListDemo...:unchecked for details. 1 error so plz send me answer why this error is coming
java Compilation
java program compilation time following error is occur in my system Note...java Compilation  import java .util.*; class ArrayListDemo...:unchecked for details. 1 error so plz send me answer why this error is coming
java Compilation
java program compilation time following error is occur in my system Note...java Compilation  import java .util.*; class ArrayListDemo...:unchecked for details. 1 error so plz send me answer why this error is coming
Java Compilation - Java Beginners
Java Compilation  I want to write a complete java program that catenates the file named "first" with the named "second" and produces a file named... working directory, give an appropriate error message and terminate the program
Java Compilation - Java Beginners
Java Compilation  How would i write a complete java program which, using a do-while loop, reads integers from the keyboard and sums them until the sum hits or exceeds 30. Then print out the sum. is it like this: import
Java Compilation - Java Beginners
Java Compilation  I want to write a Java program that asks the user for the names of 3 files. I want the first file to be opened for reading and the other two files to be opened for writing. I want the program to read
Does the object type known during compilation in Java?.
Does the object type known during compilation in Java?.  class A { } class B extends class A { } class checkType { public static void main(String[] args) { A ObjA = new B();/// Here ObjA is of type A--> this fact
program created and compilation error of connection rightly created n tested
program created and compilation error of connection rightly created n... error for connection on which other programs are running smoothly...:( import... ("there was some error in establishing connection : "+e); } sep
Java error
Java error  class WhileLoopMethod{ public static void main(String args[]){ new Hello(); } } class Hello{ int a = 5, b = 88; while(a } //it is giving compile time error .....illegal start
Java error
Java error  class WhileLoopMethod{ public static void main(String args[]){ new Hello(); } } class Hello{ int a = 5, b = 88; while(a } //it is giving compile time error .....illegal start
JAVA Annotation Error
JAVA Annotation Error  while compiling simple java program i get annotation error i.e class will only be accepted if annotation processing is explicitly requested..how to solve
pointer error java
pointer error java  How to catch null pointer errors in java if the if(value != null) or null
runtime error in java
runtime error in java  What is Run time error in Java?   Run time error is a syntax error that during the execution of a program.It hash different types of a program like as Logic error,Fatal Errors,source code,wrong
java compiler error
java compiler error  I am trying to compile a simple program which is as follows: public class A { public static void main(String args[]) { B b=new B(); } } Above program is in file A.java second program
compilation problem
compilation problem  struts 2.0 : i have included all 5 jars in lib folder,but its giving compilation problem that package open symphony doesnot exist ( though i imported it) & cant recognise SUCCESS etc symbol.i think i
compilation problem
compilation problem  struts 2.0 : i have included all 5 jars in lib folder,but its giving compilation problem that package open symphony doesnot exist ( though i imported it) & cant recognise SUCCESS etc symbol.i think i
Java code error - Java Beginners
Java code error  Hi, I am using a MooreQuery to look for neighbors in a grid: MooreQuery query = new MooreQuery(grid, this,(int) (2*myHomeRangeRadius), (int) (2*myHomeRangeRadius)); if(query != null){ for (Object
compilation fail
compilation fail  package jsptube.tutorials.servletexample; import javax.servlet.GenericServlet; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import java.io.IOException; import
Java Code Color Function Error
Java Code Color Function Error  Java Code Color Function Error
command prompt is compilation is not working
command prompt is compilation is not working   Dear java users can... and the class file is also getting generated when i run the class file using java helloworld through command prompt class not found error and class loader not able
compilation errors
compilation errors  package jsptube.tutorials.servletexample; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import
Java Error
Java Error      ... that occurs in a program. Error in java is a subclass of the Throwable class.... Most of the errors in java are abnormal conditions while the error ThreadDeath
Error during runtime NoClassDefFound in java
:\jama-1.0.2>java EigenvalueDecomposition now it gives NoClassDefFound Error. pls...Error during runtime NoClassDefFound in java  code: package Jama...[n-1][n-1] - H[n][n]) / 2.0; q = p * p + w; z
Error during runtime NoClassDefFound in java
:\jama-1.0.2>java EigenvalueDecomposition now it gives NoClassDefFound Error. pls...Error during runtime NoClassDefFound in java  code: package Jama...[n-1][n-1] - H[n][n]) / 2.0; q = p * p + w; z
XML DOM error - Java Beginners
) but im getting a error like this... "java.io.IOException: Server returned HTTP... got the error again,then send full error details. Thanks

Ads