java - ImageIO cannot resolve to a type -


just simple programming question.

import java.awt.image.bufferedimage; import java.io.file; import java.io.ioexception;   public class readthepic {     public static void main(string[] args){         bufferedimage img = null;         try {             img = imageio.read(new file("strawberry.jpg"));         } catch (ioexception e) {         }      } } 

error: imageio cannot resolved type. why?thanks

import javax.imageio.imageio; 

imageio not accessible due restriction on requiered library

you forgot import class.
add import javax.imageio.imageio after other imports , should work.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -