Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Software Development Software Development
Search Search
Search for:
Tech Support Guy > > >

Java Assistance T_T


(!)

tenshijinn's Avatar
tenshijinn tenshijinn is offline
Junior Member with 3 posts.
THREAD STARTER
 
Join Date: Sep 2006
26-Aug-2007, 09:13 PM #1
Java Assistance T_T
Hi,

I've been working on a java project for University coursework (due on Tuesday :S), I'm now rushing to complete it, its a todo list which I believe is currently within my ability to do.
However I'm receiving random errors which is seriously delaying me probably due to my lack of experience, I was wondering if I can get some pro assistance.

As of now I'm receiving an illegal start of expression message, I read around as much as I could and it seems to me it mostly involves the misplacement of brackets or methods opened within methods and etc, I really can't seem to place my error.
Can anyone give me another opinion please, my deepest gratitude.

- Busy Student


My Code:

import javax.swing.*;
import java.util.*;
import java.io.*;

public class list{

public static void main(String[]args){



Todo r = new Todo();

r.todo1 = JOptionPane.showInputDialog("Enter Subject");
r.todo2 = Integer.parseInt(JOptionPane.showInputDialog("Enter Priority Number '1 - 5' 1 being most important and 5 least"));
r.todo3 = JOptionPane.showInputDialog("Enter Due Date");



public class Todo

{
public String todo1;
public int todo2;
public String todo3;

public Todo(String t1, int t2, String t3)

{
todo1 = t1;
todo2 = t2;
todo3 = t3;
}

} // 2do close

} // main method close ---------------------------------------------------------------


} // Class list closed
Chicon's Avatar
Chicon Chicon is offline   Chicon has a birthday soon!
Computer Specs
Member with 6,650 posts.
 
Join Date: Jul 2004
Location: 50 34' 07.13" N - 04 10' 23.
Experience: Second socks retriever
27-Aug-2007, 05:04 AM #2
Hi tenshijinn,

Welcome to TSG !

As the class Todo is declared inside a method (Todo is a local inner class), the modifier public is not required
and the closing } of Todo must be followed by a ;
Also, the declaration of Todo must be made before the statement Todo r = new Todo();.

tenshijinn's Avatar
tenshijinn tenshijinn is offline
Junior Member with 3 posts.
THREAD STARTER
 
Join Date: Sep 2006
28-Aug-2007, 01:13 AM #3
Thankyou for the welcome, and thankyou so much for the help you're a godsent ^^
I'll probably be around until I graduate in about 2 years lol.

The class works perfectly thankyou very much, I'm still working on my todo method atm, hopefully I meet today's deadline
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑

Content Relevant URLs by vBSEO 3.3.2