Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

newbie with object problems
Hello,

Here are my error messages from javac -

C:\j2sdk1.4.2_02\bin>javac xx.java
xx.java:125: <identifier> expected
Vector<Object> king =new Vector<Object>();
^
xx.java:225: '(' or '[' expected
ArrayList<Object> queen = new ArrayList<Object>();
^
2 errors

Without the <Object> it compiles fine - I am on dialup so do I really
have to get 142-08?

Thanks,

LM


Report this thread to moderator Post Follow-up to this message
Old Post
leonardmatherson@hotmail.com
04-28-05 01:59 AM


Re: newbie with object problems
leonardmatherson@hotmail.com wrote:
> Hello,
>
> Here are my error messages from javac -
>
> C:\j2sdk1.4.2_02\bin>javac xx.java
> xx.java:125: <identifier> expected
>       Vector<Object> king =new Vector<Object>();
>             ^
> xx.java:225: '(' or '[' expected
>         ArrayList<Object> queen = new ArrayList<Object>();
>                                                ^
> 2 errors
>
> Without the <Object> it compiles fine - I am on dialup so do I really
> have to get 142-08?
>
> Thanks,
>
> LM
>

Generics (eg. Vector<Object> ) are a feature of 1.5.0 (aka java 5.0) and
are not available in 1.4. So, yes, if you want those features you have
to update (to 1.5).

--
Peter MacMillan
e-mail/msn: peter@writeopen.com

Report this thread to moderator Post Follow-up to this message
Old Post
Peter MacMillan
04-28-05 01:59 AM


Re: newbie with object problems
Yes. The <Object> indicates the use of generics availible only in 1.5 or
higher.

On Wed, 2005-04-27 at 14:42 -0700, leonardmatherson@hotmail.com wrote:

> Hello,
>
> Here are my error messages from javac -
>
> C:\j2sdk1.4.2_02\bin>javac xx.java
> xx.java:125: <identifier> expected
>       Vector<Object> king =new Vector<Object>();
>             ^
> xx.java:225: '(' or '[' expected
>         ArrayList<Object> queen = new ArrayList<Object>();
>                                                ^
> 2 errors
>
> Without the <Object> it compiles fine - I am on dialup so do I really
> have to get 142-08?
>
> Thanks,
>
> LM
>


Report this thread to moderator Post Follow-up to this message
Old Post
Aleksandar Pecanov
04-28-05 01:59 AM


Re: newbie with object problems
Peter MacMillan coughed up:
> leonardmatherson@hotmail.com wrote: 
>
> Generics (eg. Vector<Object> ) are a feature of 1.5.0 (aka java 5.0)

ICBW, but isn't it simply "java 5", with no revision?  I think it's one of
those marketing hoohah moments.  Very confusing from the get-go.  Like
having "Java 2" with jdk revs in the 1's.


> and are not available in 1.4. So, yes, if you want those features you
> have to update (to 1.5).



--
Everythinginlifeisrealative. Apingpongballseemssmalluntilsomeoneramsi
tupyourn
ose.



Report this thread to moderator Post Follow-up to this message
Old Post
Thomas G. Marshall
04-28-05 09:04 AM


Re: newbie with object problems
Thomas G. Marshall wrote:
> Peter MacMillan coughed up: 
>
>
> ICBW, but isn't it simply "java 5", with no revision?  I think it's one of
> those marketing hoohah moments.  Very confusing from the get-go.  Like
> having "Java 2" with jdk revs in the 1's.

http://java.sun.com/j2se/1.5.0/docs...ersion-5.0.html

"Both version numbers "1.5.0" and "5.0" are used to identify this
release of the Java 2 Platform Standard Edition. Version "5.0" is the
product version, while "1.5.0" is the developer version. The number
"5.0" is used to better reflect the level of maturity, stability,
scalability and security of the J2SE."

Of course, the -source parameter to javac accepts 1.5 and 5.

--
Peter MacMillan
e-mail/msn: peter@writeopen.com

Report this thread to moderator Post Follow-up to this message
Old Post
Peter MacMillan
04-28-05 09:04 AM


Re: newbie with object problems
Peter MacMillan coughed up:
> Thomas G. Marshall wrote: 
>
> http://java.sun.com/j2se/1.5.0/docs...ersion-5.0.html
>
> "Both version numbers "1.5.0" and "5.0" are used to identify this
> release of the Java 2 Platform Standard Edition. Version "5.0" is the
> product version, while "1.5.0" is the developer version. The number
> "5.0" is used to better reflect the level of maturity, stability,
> scalability and security of the J2SE."

Thanks for the link.  Clears it up a tad.


> Of course, the -source parameter to javac accepts 1.5 and 5.



--
 Forgetthesong,I'dratherhavethefrontallob
otomy...



Report this thread to moderator Post Follow-up to this message
Old Post
Thomas G. Marshall
04-28-05 09:04 AM


Re: newbie with object problems
Peter MacMillan <peter@writeopen.com> writes:

> "Both version numbers "1.5.0" and "5.0" are used to identify this
> release of the Java 2 Platform Standard Edition. Version "5.0" is the
> product version, while "1.5.0" is the developer version. The number
> "5.0" is used to better reflect the level of maturity, stability,
> scalability and security of the J2SE."

The really funny bit is if they do a "Solaris" next, and use 5.1 for
1.6.0.

Report this thread to moderator Post Follow-up to this message
Old Post
Tor Iver Wilhelmsen
04-28-05 01:58 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Help archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:33 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.