For Programmers: Free Programming Magazines  


Home > Archive > Java Help > April 2005 > newbie with object problems









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author newbie with object problems
leonardmatherson@hotmail.com

2005-04-27, 8:59 pm

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

Peter MacMillan

2005-04-27, 8:59 pm

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
Aleksandar Pecanov

2005-04-27, 8:59 pm

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
>


Thomas G. Marshall

2005-04-28, 4:04 am

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
tupyournose.


Peter MacMillan

2005-04-28, 4:04 am

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
Thomas G. Marshall

2005-04-28, 4:04 am

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...


Tor Iver Wilhelmsen

2005-04-28, 8:58 am

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.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com