How advanced is java 1.6 with respect to java 1.1 ?

B

broli

I've learned java 1.1 using a relatively old video tutorial and
realized it only later.

Is java 1.1 similar to java 1.6 or is it radically different ?

And if its similar, what additional features do I need to learn ?
 
A

Arne Vajhøj

broli said:
I've learned java 1.1 using a relatively old video tutorial and
realized it only later.

Is java 1.1 similar to java 1.6 or is it radically different ?

And if its similar, what additional features do I need to learn ?

Everything you have learned is still valid (except for a few very
obscure points).

But there has added some things to the Java language.

And the Java library is much much bigger.

So you will need to learn some more before you are
uptodate on Java 1.6.

Arne
 
M

Mike Schilling

Arne said:
Everything you have learned is still valid (except for a few very
obscure points).

But there has added some things to the Java language.

The biggest ones being inner classes and generics.
 
L

Lew

broli said:
I've learned java [sic] 1.1 using a relatively old video tutorial and
realized it only later.

Is java [sic] 1.1 similar to java [sic] 1.6 or is it radically different ?

And if its similar, what additional features do I need to learn ?
Everything you have learned is still valid (except for a few very
obscure points).

But there has added some things to the Java language.

And the Java library is much much bigger.

So you will need to learn some more before you are
uptodate on Java 1.6.

A lot more.

The Collections framework, 'assert', generics, the new memory model,
additional run-time options (e.g., for the garbage collector), the 'for-each'
loop construct, and a number of stylistic and idiomatic changes, plus
gazillions of new APIs (NIO and java.util.concurrent to name two). And so
much more.

For God's sake, don't use java.util.Vector or java.util.Hashtable any more.

Synchronization is now much, much less expensive. Allocation and garbage
collection are now much, much faster. Swing has come into existence, and been
infinitely improved. Java Enterprise Edition has appeared, with many good
implementations, some of them open source.

There is a ton of documentation on these issues and more. java.sun.com and
http://www.ibm.com/developerworks/java are good sources for tutorials and
articles. Read and study Joshua Bloch's /Effective Java/ and Brian Goetz's
/Java Concurrency in Practice/. For starters.
 
D

Daniel Pitts

broli said:
I've learned java 1.1 using a relatively old video tutorial and
realized it only later.

Is java 1.1 similar to java 1.6 or is it radically different ?

And if its similar, what additional features do I need to learn ?

Java 1.1 programs will work in Java 1.6, but you will miss a *lot* of
powerful features/libraries/speed/etc... that has been added over the years.

Note, Java 1.1 was released over a decade ago, and Java has been almost
constantly improving in the mean time.
<http://java.sun.com/j2se/codenames.html>
 
B

broli

Alright, then in that case I will switch to a more recent book.

It seems the only things similar is the basic syntax, control loops
etc.
 
T

Tom Anderson

The biggest ones being inner classes and generics.

I'd say the biggest one is collections. Those came in in 1.2, and made a
huge difference to everyday programming.

There were some massive changes on the GUI side around then, too - i don't
think the basics of AWT changed much from 1.1 to 1.2 (they did from 1.0 to
1.1), but isn't that when Swing came in?

tom
 
P

prabesh shrestha

For God's sake, don't use java.util.Vector or java.util.Hashtable any more.

I use java.util.Vector a lot.What's the alternative you suggest?

Prabesh Shrestha
 
J

John B. Matthews

prabesh shrestha said:
I use java.util.Vector a lot.What's the alternative you suggest?

When any ordered collection (sequence) that implements the List or Map
interface will do, select the one that does what you want with the least
extra baggage. For example, I'd prefer ArrayList to Vector when
synchronization is not required; I'd prefer LinkedList to Stack and
HashMap to HashTable for a similar reason. Conversely, I wouldn't use
ConcurrentSkipListMap when a plain old HashMap is sufficient.

<http://java.sun.com/javase/6/docs/api/java/util/List.html>
<http://java.sun.com/javase/6/docs/api/java/util/Map.html>
 
L

Lew

That class was replaced over *ten* years ago! Why are you still using it?
When any ordered collection (sequence) that implements the List or Map
interface will do, select the one that does what you want with the least
extra baggage. For example, I'd prefer ArrayList to Vector when
synchronization is not required; I'd prefer LinkedList to Stack and
HashMap to HashTable for a similar reason. Conversely, I wouldn't use
ConcurrentSkipListMap when a plain old HashMap is sufficient.

<http://java.sun.com/javase/6/docs/api/java/util/List.html>
<http://java.sun.com/javase/6/docs/api/java/util/Map.html>

Quite in line with the advice to incur "the least extra baggage",
'Collections.synchronizedList(List)' is better than 'Vector 'and
'Collections.synchronizedMap(Map)' is better than 'Hashtable'. They don't
have extraneous methods and related classes that are outside the collections
framework.

<http://java.sun.com/javase/6/docs/api/java/util/Collections.html#synchronizedList(java.util.List)>
<http://java.sun.com/javase/6/docs/api/java/util/Collections.html#synchronizedMap(java.util.Map)>

'Vector' has methods like 'elementAt()' and helper classes like 'Enumeration'
that you don't need in original code, and 'Hashtable' also pulls in
'Enumeration'.

The Javadocs for 'Stack' tell us:
A more complete and consistent set of LIFO stack operations
is provided by the Deque interface and its implementations,
which should be used in preference to this class.

See also:
<http://java.sun.com/javase/6/docs/api/java/util/Collections.html#asLifoQueue(java.util.Deque)>
<http://java.sun.com/javase/6/docs/api/java/util/concurrent/LinkedBlockingDeque.html>

There really is no good reason to use those antiquated legacy classes any
more. Their replacement predates the time when most anybody making money
writing Java code started doing so.
 
A

Arne Vajhøj

Tom said:
I'd say the biggest one is collections. Those came in in 1.2, and made a
huge difference to everyday programming.

Collection framework came in 1.2, but Vector and Hashtable did exist
before.
There were some massive changes on the GUI side around then, too - i
don't think the basics of AWT changed much from 1.1 to 1.2 (they did
from 1.0 to 1.1), but isn't that when Swing came in?

Swing came in 1.2 (I believe it could be used in 1.1 as an extra
library).

Arne
 
J

Joshua Cranmer

prabesh said:
I use java.util.Vector a lot.What's the alternative you suggest?

It depends. Do you want an O(N) random-access list but O(1) head/tail
insertion/deletion? Or an O(1) random-access list but O(N) head
insertion/deletion and O(1) amortized tail insertion/deletion?

If you read the documentation for java.util.Vector, you'll notice that
it contains a strong warning to use other collections; the only reason
it's not deprecated is because non-deprecated APIs have to use it.
 
T

Tom Anderson

Collection framework came in 1.2, but Vector and Hashtable did exist
before.

True. But collections added loads more stuff, including an Iterator
interface that wasn't as agonising to use as Enumeration.

tom
 
R

Roedy Green

Is java 1.1 similar to java 1.6 or is it radically different ?

And if its similar, what additional features do I need to learn ?

See http://mindprod.com/jgloss/jdk.html
for a list of major features added with each version.
The big advances I would say are

Collections
Swing
Assertions
for:each
autoboxing
Generics
--
Roedy Green Canadian Mind Products
http://mindprod.com
PM Steven Harper is fixated on the costs of implementing Kyoto, estimated as high as 1% of GDP.
However, he refuses to consider the costs of not implementing Kyoto which the
famous economist Nicholas Stern estimated at 5 to 20% of GDP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top