• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem compiling code  RSS feed

 
Tom Sinclair
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey everybody,

I'm brand new to java and I'm getting really frustrated that this will sample of code will not compile. I have double checked it and it seems ok? This is the error I get when I go to compile:

Chap2Ex1.java:17: error: cannot find symbol
System.out.printIn("the values of x and y are:" +"" + x + "" + y);
^
symbol: method printIn(String)
location: variable out of type PrintStream
2 errors

Here's my code so far:

import java.util.Scanner;

public class Chap2Ex1
{
public static void main(String[] args)
{
double x , y ;
Scanner keyboard = new Scanner(System.in);

System.out.printIn("enter a number with a decimal point:");


x = keyboard.nextDouble();

y = 1.0 / x;

System.out.printIn("the values of x and y are:" +"" + x + "" + y);

}

}


Please help! I'm taking an online class and it's kicking my butt...

 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like you spelt "println" with a capital "i", but that's a lowercase "L" in there. "println" is short for "print line".
 
Tom Sinclair
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just changed both to lowercase i's in "printIn" still get the same message
 
Tom Sinclair
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry I was so frustrated I didn't read your post correctly!!! thank you so much!!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!