Not Yet Answered # error explanation

rinoa04 2 Discussion Starter maelthra bugmenot 25 rinoa04 2 Discussion Starter maelthra jwenting 1,594 bugmenot 25 Discussion Starter maelthra mailmeatvishnu Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...

0

Most probably the .class file that you are trying to run is not a driver class where the main method is coded to call and run the coding.

0

Well I am using the file from another post here in the forums, I was playing around look for code to go through to better my understanding.

the file is attached below, it compiles fine but won't run, and I get the afore mentioned error.

0

it appears to be an applet. you usually have to embed the applet in an HTML page using applet tags and use a browser to run it

1

To run an applet, you will need an html file with this example coding:

<Html>

<Head>

<Title>Java Example</Title>

</Head>

<Body>

This is my page<br>

Below you see an applet<br>

<br>

<Applet Code="MyApplet.class" width=200 Height=100>

</Applet>

</Body>

</Html>

You must specify the .class file that you compile at the applet code tag. Use appletviewer command to run the html file on DOS.

0

okay I played with the code did something different, so that I don't have to use, html. but I am getting all of these errors file is attached. if anyone could help me I would be very happy... LOL

F:\Javawork\Multiplication\Multiplication.java:22: <identifier> expected

System.out.println("How much is "); int = Number1 (" TIMES "); int = Number2 (" ? ");

^

F:\Javawork\Multiplication\Multiplication.java:22: illegal start of type

System.out.println("How much is "); int = Number1 (" TIMES "); int = Number2 (" ? ");

^

F:\Javawork\Multiplication\Multiplication.java:22: <identifier> expected

System.out.println("How much is "); int = Number1 (" TIMES "); int = Number2 (" ? ");

^

F:\Javawork\Multiplication\Multiplication.java:22: <identifier> expected

System.out.println("How much is "); int = Number1 (" TIMES "); int = Number2 (" ? ");

^

F:\Javawork\Multiplication\Multiplication.java:23: <identifier> expected

UserAnswer = input.nextInt();

^

F:\Javawork\Multiplication\Multiplication.java:26: illegal start of type

if ( int = UserAnswer == int = ActualAnswer ) // if answer is correct

^

F:\Javawork\Multiplication\Multiplication.java:26: <identifier> expected

if ( int = UserAnswer == int = ActualAnswer ) // if answer is correct

^

F:\Javawork\Multiplication\Multiplication.java:26: ';' expected

if ( int = UserAnswer == int = ActualAnswer ) // if answer is correct

^

F:\Javawork\Multiplication\Multiplication.java:26: illegal start of type

if ( int = UserAnswer == int = ActualAnswer ) // if answer is correct

^

F:\Javawork\Multiplication\Multiplication.java:26: <identifier> expected

if ( int = UserAnswer == int = ActualAnswer ) // if answer is correct

^

F:\Javawork\Multiplication\Multiplication.java:26: ';' expected

if ( int = UserAnswer == int = ActualAnswer ) // if answer is correct

^

F:\Javawork\Multiplication\Multiplication.java:30: illegal start of type

if ( int = UserAnswer != int = ActualAnswer ) // if answer is not correct

^

F:\Javawork\Multiplication\Multiplication.java:30: <identifier> expected

if ( int = UserAnswer != int = ActualAnswer ) // if answer is not correct

^

F:\Javawork\Multiplication\Multiplication.java:30: ';' expected

if ( int = UserAnswer != int = ActualAnswer ) // if answer is not correct

^

F:\Javawork\Multiplication\Multiplication.java:30: illegal start of type

if ( int = UserAnswer != int = ActualAnswer ) // if answer is not correct

^

F:\Javawork\Multiplication\Multiplication.java:30: <identifier> expected

if ( int = UserAnswer != int = ActualAnswer ) // if answer is not correct

^

F:\Javawork\Multiplication\Multiplication.java:30: ';' expected

if ( int = UserAnswer != int = ActualAnswer ) // if answer is not correct

^

17 errors

Tool completed with exit code 1

0

do you know any Java at all?

Those lines are utter nonsense in the light of the language specification.

0

um.. so for starters, you know that you can only put code in methods? you can't have statements randomly outside methods

0

okay this program is almost halfway done, right now I have no errors and the file runs fine, except I need it to ask another random question if the user gets the right answer, or back to the same question if the user gets it wrong. I am thinking of using if-else or while statements, but I am not sure how to form them. attached is the current file as is.

0

check wether u had saved the name of file as a class which has got main method....remember it is case sensitive

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

When I execute this progammatically, I get a table with row heights much larger than when I do this manually.

Note : Sel is the Word.Selection object and the Clipboard contains an Excel Table.

```
public void AddClipboard()
{
Sel.PasteExcelTable(false,false, false);
var t = Sel.Tables[Sel.Tables.Count];
t.AutoFitBehavior(Word.WdAutoFitBehavior.wdAutoFitContent);
}
```

the function that I created to find the ...