I do not know how to change the code in java?

Issue

This Content is from Stack Overflow. Question asked by SHUN SANG WONG HO

This is the display.
I don’t the following errors.

C:Lab3_220107521>javac ty.java
    ty.java:5: error: not a statement
       double 6n;
       ^
    ty.java:5: error: ';' expected
       double 6n;
             ^
    ty.java:5: error: not a statement
       double 6n;
               ^
    ty.java:6: error: not a statement
            6n = 2 * 6n;
            ^
    ty.java:6: error: ';' expected
            6n = 2 * 6n;
             ^
    ty.java:6: error: ';' expected
            6n = 2 * 6n;
                      ^
    6 errors

This is my try

public class ty{
     public static void main(String [] argv) {
           
       double 6n;
        6n = 2 * 6n;
    
        }
    }

I tried several times.
I don’t know how to change the error of the code.



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?