I Think this is a really big Bug [CAN'T FIX]

Why is this:`package anger;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;

import javax.swing.JOptionPane;

public class asdf {

public static void main(String[] args) {
    BufferedReader rd;
    boolean iThinkThisIsABug = false;
        if(iThinkThisIsABug = true)
            rd = new BufferedReader(new FileReader("C:\\users\\Dominik Gyarmati\\AppData\\Roaming\\KeepSafe\\users\\ajd.txt" ));


    catch (FileNotFoundException ex){



Why is this giving me a FileNotFoundException when the Local Variable is false? This makes no sense to me!


  • I don't think it's a bug though I'm not familiar with try/catch yet (I'm a beginner). Probably there's a better way to combine if and try blocks (one might ignore the other), Also, shouldn't that equal sign be a double one?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion