First post Hello, and quick question (I hope)
Hello everyone,
I am new to java, and hoping to get better over the next few months.
I am trying to write a simple program to do a measurement conversion and I am receiving this error "class, interface, or enum expected" i have listed the code below:
importjava.io*;
public class VoiceExample {
public static void main(String[] args) {
ConsoleReader console = new ConsoleReader(System.in);
System.out.println("Please enter the time in Seconds.");
double sec = console.readDouble ();
final int KBYTE = 1024;
final int VOICE_BYTES_PER_SECOND = 8000;
final int VOICE_KB_PER_SECOND = VOICE_BYTES_PER_SECOND / KBYTE;
double voiceKB= sec / VOICE_KB_PER_SECOND;
System.out.println();
}//end of main method
}//emd of class VoiceExample
Thanks for any help!
Re: First post Hello, and quick question (I hope)
Check your spelling, check your space between identifiers. A compiler is very persnickety about what it will accept.
Re: First post Hello, and quick question (I hope)
There are typos in the import line. And ConsoleReader is not a standard Java class, so you'll need to import some 3rd party library for that.
Read whatever documentation came with the problem you're working on. And with whereever you got it for typos or other misinformation. I mention this because exactly the same code is mentioned in the discussion here: Newb java problem
Re: First post Hello, and quick question (I hope)