Aeren
Newbie level 3
Hi everyone! I encountered 2 problems when trying to make my program.
First, I wrote this as Main:
And it says: Can't find symbol:NetMyThread(it's another class i wrote)
My second problem is with NetMyThread:
It compiles, but says:
Note: F:\3\NetMyThread.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
I've checked it, and it's because i'm using Vectors. I make a new Vector, then try to add several Strings to it like this:
where in is an opened file.
Anyone knows why this is a problem?
Thanks!!!
Aeren
Added after 58 minutes:
Second problem is solved. The vector should have a type(String by my case)
Vector<String> abc = new Vector<String>();
First, I wrote this as Main:
Code:
import java.io.*;
import java.util.*;
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
public class Main extends Applet {
public static void main (String args[]) {
// new Graphics();
System.out.println("Elindultunk!");
NetMyThread progi = new NetMyThread( 1, 5000, "F:\1\1.txt", "F:\1\2.txt", "lines", "fast" );
}
}
My second problem is with NetMyThread:
It compiles, but says:
Note: F:\3\NetMyThread.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
I've checked it, and it's because i'm using Vectors. I make a new Vector, then try to add several Strings to it like this:
Code:
String str;
while( ( str = in.readLine( ) ) != null ) {
sourceElements.add( new String( str ) );
}
Anyone knows why this is a problem?
Thanks!!!
Aeren
Added after 58 minutes:
Second problem is solved. The vector should have a type(String by my case)
Vector<String> abc = new Vector<String>();