Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is my compiler telling me there is a Uncompilable source code?
    primarykey
    data
    text
    <p>I have trouble with NetBeans quite frequently. Earlier I was able to run this program no problem, but now, it tells me this after running it</p> <p>"Exception in thread "main" java.lang.RuntimeException: Uncompilable source code -cannot find symbol symbol: class Loop1 location: class hw7 at hw7.main(hw7.java:72)"</p> <pre><code>import java.util.Scanner; class forLoops { void forLoop1(){ Scanner in = new Scanner(System.in); int cnt = 2; System.out.print("Enter n:"); int n = in.nextInt(); for (int i = 1; i &lt;= n; i++) { for (int j = 1; j &lt;= i; j++){ if (i == 1) System.out.print(1); else if (i &gt; 1) { System.out.printf("%3d", cnt); cnt++; } } System.out.println(); } } void forLoop2(){ Scanner in = new Scanner(System.in); System.out.print("Enter n:"); int n = in.nextInt(); for (int i = 1; i &lt; n+1; i++) { int sum = 0; for (int j = 0; j &lt; i; j++){ System.out.printf("%3d", i+sum); sum = sum + n-(j+1); } System.out.println(); } } void forLoop3(){ Scanner in = new Scanner(System.in); System.out.print("Enter n:"); int n = in.nextInt(); int x = 1; for (int i = 1; i &lt; n+1; i++) { int sum = 0; for (int j = 0; j &lt; i; j++){ System.out.printf("%3d", i+sum); sum = sum + n-(j+1); } System.out.println(); } } } public class hw7 { public static void main(String[] args) { Scanner in = new Scanner(System.in); forLoops myL1 = new forLoops(); myL1.forLoop1(); forLoops myL2 = new forLoops(); myL2.forLoop2(); Loops myL3 = new forLoops(); myL3.forLoop3(); } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload