±Û¾´ÀÌ :¹ÚÀçÇü 2000³â 1¿ù 27ÀÏ 20:15:50
¾È³çÇϼ¼¿ä. ÀÚ¹Ù·Î ÀÛ¼ºÇÑ Å¬·¡½º°¡ µÎ°³°¡ Àִµ¥¿ä. (Çϳª´Â InputURL.java, ´Ù¸¥ Çϳª´Â Test.java) compileÇÒ ¶§ main ¸Þ¼Òµå¿¡¼ InputURL Ŭ·¡½º¸¦ È£ÃâÇÕ´Ï´Ù.
±Ùµ¥ InputURLÀ» compile Çϸé error ¾øÀÌ ¼öÇàµÇ´Âµ¥, Test¸¦ compileÇÏ¸é ´ÙÀ½°ú °°Àº ¿¡·¯ ¸Þ½ÃÁö°¡ ¶å´Ï´Ù. InputURL Ŭ·¡½ºÀÇ »ý¼ºÀÚ´Â ¸Å°³º¯¼ö Çϳª¸¸ È£ÃâÇϴµ¥...
¿øÀÎÀÌ ¹«¾ùÀÎÁö ¾Ë·ÁÁÖ¼¼¿ä.
// error message
Test.java:20: Wrong number of arguments in constructor.
iu = new InputURL(input_url);
^
1 error
¾Æ·¡ µÎ Ŭ·¡½ºÀÇ ¼Ò½ºÄڵ带 ¿Ã¸³´Ï´Ù.
// Test.java
import java.io.*;
import java.net.*;
import java.lang.System;
public class test {
public static void main(String[] args) throws IOException {
InputURL iu;
File inputFile = new File("Channel_URL.txt");
FileInputStream in = new FileInputStream(inputFile);
BufferedReader Channel_in = new BufferedReader(new InputStreamReader(in));
String input_url;
while((input_url = Channel_in.readLine()) != null) {
iu = new InputURL(input_url);
}
in.close();
}
}
// InputURL.java
import java.net.*;
import java.lang.System;
class InputURL {
public String input_Url;
public void InputURL(String input_Url) { //Test.java¿¡¼ ³Ñ°Ü¹Þ´Â string
this.input_Url = new String(input_Url);
try {
URL channel = new URL(input_Url);
BufferedReader read_html = new BufferedReader( new InputStreamReader(channel.openStream()));
:
:
ó¸® ºÎºÐ
:
:
}catch () {
}catch () {
}
}
}