0

IntellIJ Idea 2019

In my java file:

package com.java.testproject.java.TestProjectJava.leetcode;

public class TwoSum {

    public TwoSum() {

    }
}

Here client code:

public class Main {
    public static void main(String[] args) {
        System.out.println("Java version: " + System.getProperty("java.version"));
        System.out.println("Current date: " + new Date());
        System.out.println();

        new TwoSum();
}

But When compile I get error:

enter image description here

what is wrong with my code?

Alexei
  • 14,350
  • 37
  • 121
  • 240
  • 1
    Maybe file is saved with Unicode BOM? – Dalija Prasnikar Oct 13 '19 at 11:10
  • Yes, after change , to "with no BOM", then success run. What is wrong with BOM ? – Alexei Oct 13 '19 at 11:21
  • 1
    Some editors have issues with it. Specifically, with UTF-8 BOM. You can find more at [What's the difference between UTF-8 and UTF-8 without BOM?](https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-without-bom) – Dalija Prasnikar Oct 13 '19 at 11:27

0 Answers0