Skip to content

Comments at the beginning of a program result in errors but they should not #8

@sergutsan

Description

@sergutsan

The following code

/*
  Write a program that asks a number from the user, then says whether the number is prime or not. Remember that
  a number that is divisible by any number apart from 1 and itself is prime. You can use the modulo operator (if
  a % b is zero, then a is divisible by b).
*/
println ("Enter an integer");
int b = readInt();

is correct, but it produces an error:

JavaDecaf Error: Stand-alone method not started properly
file:/tmp/error1.jdc

If the comments are removed, the code compiles without problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions