0

/**
* This method will ask the user for some information, create a blank picture to use as a palette and create and display the palette.
*/
186 public static void main(String[] args) {
187 int redValue;
188 Scanner sc = new Scanner(System.in);
189 System.out.print("Enter a Red value: ");
190
191 // Get the value
192 redValue = sc.nextInt();
193 this.createPalette(redValue);
}

i get these errors :
3 errors found:
File: D:\Series\drjava\bookClasses\Picture.java [line: 188]
Error: D:\Series\drjava\bookClasses\Picture.java:188: cannot find symbol
symbol : class Scanner
location: class Picture
File: D:\Series\drjava\bookClasses\Picture.java [line: 188]
Error: D:\Series\drjava\bookClasses\Picture.java:188: cannot find symbol
symbol : class Scanner
location: class Picture
File: D:\Series\drjava\bookClasses\Picture.java [line: 193]
Error: D:\Series\drjava\bookClasses\Picture.java:193: non-static variable this cannot be referenced from a static context

3
Contributors
4
Replies
6
Views
7 Years
Discussion Span
Last Post by vict0rjr
0

/**
i get these errors :
...
File: D:\Series\drjava\bookClasses\Picture.java [line: 188]
Error: D:\Series\drjava\bookClasses\Picture.java:188: cannot find symbol
symbol : class Scanner
location: class Picture
File: D:\Series\drjava\bookClasses\Picture.java [line: 188]
Error: D:\Series\drjava\bookClasses\Picture.java:188: cannot find symbol
symbol : class Scanner
location: class Picture

In the class Picture do you import the class Scanner using the following code?

import java.util.Scanner;
0

In the class Picture do you import the class Scanner using the following code?

import java.util.Scanner;

Yes I did and i still dont know why i get the error im consufed

0

don't worry i already found the problem thank you anyways..

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.