I'm learning java and I have a problem:
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.io.PrintWriter;
import java.util.*;
public class edytor{
public static void main(String[] args) throws FileNotFoundException
{
Scanner czynowy = new Scanner(System.in);
System.out.println("Do you wanna editing existing file?");
String tn = czynowy.nextLine() ;
if(tn=="t")
{System.out.println("bleble"); }
Scanner odpowiedz = new Scanner(System.in);
System.out.println("Type file name");
String polozenie = odpowiedz.nextLine() ;
System.out.println("################################");
PrintWriter zapis = new PrintWriter(polozenie);
Scanner tekst = new Scanner(System.in);
String tekst1 = tekst.nextLine() ;
zapis.println(tekst1);
zapis.close();
}
}
It's compiling, but when in string tn I type t char this doesn't print "bleble". What should I do to make it work? Greetings!