java - My program keeps saying that the method cannot be resolved -


this program should tell me if can find file naming. eclipse has no red lines every time run error message , don't know why. thank in advance can provide.

import java.io.file;  public class stockmarket {     public stockmarket(string[] args) {         readfiles r = new readfiles();         system.out.println(r.checkisfile());     } } 

and second class

import java.io.*;  import java.util.stringtokenizer;   public class readfiles {     public static void main(string[] args) {         system.out.println("test");         file file = new file("c:\\stocks\\yahoo.csv");         int row = 0;         string[] [] items;     }      public boolean checkisfile() {         file file= new file("c:\\stocks\\yahoo.csv");         return file.isfile();     } } 

error message:

exception in thread "main" java.lang.error: unresolved compilation problem:  checkisfile cannot resolved or not field     @ stockmarket.main(stockmarket.java:6) 

a few things try.

it looks readfiles class not being compiled.

you might try adding import statement readfiles class main.

do clean build.

also aware eclipse goes "weird" , need combination of close reopen and/or clean workspace and/or reboot. know think modern software... still happens.

here couple of links may help.

keeping eclipse running clean

restarting eclipse clean if cannot run eclipse command line (mac osx)

as aside, on prior projects , versions of eclipse found myself having ended setting eclipse launch clean option.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -