English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

import cs1.keyboard;
public class MaxofTwo
{
public static void main (String [] args)
{
int n1; //define variable n1
int n2; //define variable n2
System.out.println ("Please enter the 1st number:");
n1 = keyboard.readInt();
System.out.println ("Please enter the 2nd number:");
n2 = keyboard.readInt();
if (n1>n2)
System.out.println ("The maximum number is : "+num1);
else
System.out.println ("The manximum number is: "+num2);
}
}





Compilation error : Package cs1 does not exist.

2007-03-10 23:07:23 · 6 answers · asked by Starzar 1 in Computers & Internet Programming & Design

what should i do then?

2007-03-10 23:11:57 · update #1

seriously i dont understand what u guys talking abt. abt the library and path...im just a newbie in java and need to be coached with specific directions..sorry.

2007-03-10 23:42:55 · update #2

wheres cs.1? whats the meaning of it?

2007-03-10 23:56:48 · update #3

6 answers

Where is the class cs1 located, just copy the class in the same directory

2007-03-10 23:34:21 · answer #1 · answered by Anonymous · 0 0

You need to put cs1 in a correct place and have -classpath specified to locate it for inclusion in compilation.

The code for this simple program is correct, except there is no num1 num2 but n1 n2. Just move cs1 under the same directory and specify -classpath=. as part of javac line.

2007-03-11 07:24:04 · answer #2 · answered by Andy T 7 · 0 0

Did you make a cs1 package with the keyboard class under that package? Make sure that you have a package named "cs1". Maybe the package has another name.

Try using Netbeans or any other Ide to write your programs. It is quicker to see if you are missing something or forgot to code something.

2007-03-11 07:20:05 · answer #3 · answered by solitaryfalcon 2 · 0 0

"import cs1.keyboard;"
That line. You'll need to import the file or give its full location since your program obviously cannot find it on its own.

2007-03-11 07:10:49 · answer #4 · answered by Anonymous · 0 0

put cs1 in the same directory (that is if it exists!!)

2007-03-11 07:51:07 · answer #5 · answered by abd 5 · 0 0

em... what language is this?

2007-03-11 07:23:03 · answer #6 · answered by Kheme 5 · 0 0

fedest.com, questions and answers