[英]How do I fix "java: cannot find symbol" error when making URL
Everytime I run my code, I get this same error:每次我运行我的代码时,我都会遇到同样的错误:
Error:错误:
java: cannot find symbol
symbol: class url
location: class Main
My Code:我的代码:
URL intro = new url("URL goes in here");
BufferedReader intr = new BufferedReader(new InputStreamReader(intro.openStream()));
My Imports:我的进口:
import javax.swing.*;
import java.awt.datatransfer.StringSelection;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.net.URL;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.HttpURLConnection;
How do I fix please.请问我该如何解决。
When you new url("URL goes in here")
, it should be URL
当你
new url("URL goes in here")
,它应该是URL
Btw, try to consider try with resource pattern in the code顺便说一句,尝试在代码中考虑尝试使用资源模式
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.