views:

272

answers:

12

Hello all, I want to know some features which are very useful and specific to java. As i am java developer, when people asks me about some good programming features which are available in java not in any other languages, then which you think i can tell them.

That is, if i tell these features to them, then they should find out that i am a java developer.

+1  A: 

One i think is that, java is the only language which is considered to be a Platform and a Framework.

GK
Depends on what you mean by platform, but... not hardly. C#/CLR, Ruby-on-rails, Python with its libraries. Any self-respecting language these days comes with a substantial set of libraries.
Pontus Gagge
according to the answer i got here, platform is the one where we run, and framework is the one where we develop. so java can do both
GK
+8  A: 

the strength of java is the jvm and the tons of opensource libraries available.

the programming language was certainly good some years ago, but now there are better languages, and some of them run on the jvm too (scala, groovy).

naaka
I'm sorry, but from my experience with Groovy I wouldn't say it was a 'better' language. Shorter isn't necessarily better, and 'def' is the root of all evil.
James Camfield
ok your point is right.probably "better" is not the best word to use.i just meant that there are languages that came later than java and are generally more powerful and coincise.obviously the more power you give to a user, the more chance there is that he makes wrong decisions.but i have seen very messy and unreadable code in java too.and it was surely longer :)by the way i really prefer the type inference approach of scala!
naaka
A: 

The different layout-options/layout managers(clickable) for your forms maybe?

Altho, WPF is gaining ground 'cause of being vectorbased.

J. Vermeire
A: 

Jave is the only language that has a java compiler and a java syntax.

Preet Sangha
-1 for stupidity
Charlie Somerville
cheers for that.
Preet Sangha
I don't understand. Could you elaborate?
fastcodejava
http://xkcd.com/703/
KitsuneYMG
+9  A: 

Mandatory exception specifications. Oh, wait, you wanted useful...!

Sorry for the dig, but Java, like all other languages, carries its burden of idiosyncracies and experimentation. Some of it worked out (Java really helped push interfaces to the forefront of statically type checked OO languages, as well as built in documentation generation, even if it was not the first attempt at either), while some of it didn't (see above).

I doubt you're going to find unique and useful Java features which cannot be found, copied or emulated in other languages. What's uniquely good (and bad) about Java is the combination of particular features, existing tools and libraries, and wide-spread development skills out there.

Pontus Gagge
It's kinda obvious: if a language feature is useful, it's not going to stay unique for very long.
Michael Borgwardt
Mandatory exception specifications existed in Modula-3 long before Java was even a gleam in Sun's mailman's eyes.
JUST MY correct OPINION
@ttmrichter: There's nothing new under the Sun... Out of curiosity: have you used Modula-3 yourself? Outside academia? For any kind of large-scale programming? I was under the impression that it never got a twentieth of the following Pascal (in various bastardized dialects) achieved.
Pontus Gagge
+3  A: 

I guess you cannot name a feature of Java that no other language has except for one: The amount of open-source/free frameworks and libraries that are out there.

For every problem you encounter there's a library. You want a http client? Take the Apache one. A powerful Dependeny Injection framework? Spring or Struts or whatever else. Need a free server to deploy the whole thing? Tomcat. O/R-Mapping? Hibernate with Annotations. Or iBatis. Combine the whole thing with maven2 and your project is ready to go, managing all these dependencies.

f1sh
I'm quite sure there are more OS frameworks for C than for Java. Simply because C has been around for much longer.
nikie
@nikie: I really don't think so. There are many great C libraries out there but they don't really compare to Java Frameworks (libraries and frameworks are somewhat different things anyway.)
pmr
Actually, I've had a problem finding a Java API that will solve stiff ordinary differential equations. In the end, I went with Python for that reason (and boy am I glad I did!).
Chinmay Kanchi
A: 

I think I agree more or less on everything, but the best feature you can tell them Java has is that you know how to develop with it.

Javi Roman
A: 
  • The language is type safe
  • Great tool support(IDEs, Containers, Build tools(Ant, Maven), Maven from multiple vendors
  • (Mostly) platform independent
  • No memory leaks :P
  • Java Community Process (JCP) and Java Specification Requests (JSR)
Gilgamesh
Type safety is not unique to Java. Tool support is not unique to Java. Platform independence is not unique to Java. Java does leak memory AND garbage collection is not unique to Java. Bureaucracy is not unique to Java. The original poster wanted things specific to Java and you gave a list of features that are as common as dirt.
JUST MY correct OPINION
+4  A: 

Java's Object Oriented Enums.

(Of course you can emulate them in other languages; but in my knowledge Java happens to be the only language which has language level support for them.)

missingfaktor
+1 Enums, when properly used, are very powerful.
Helper Method
c++0x has these too.
KitsuneYMG
C# has object-oriented enums with language support as well.
Daniel Pryden
@kts, @Daniel: C++0x and C# only have scoped enums. Please see the link I have posted to understand what I mean by OO enums.
missingfaktor
@kts: This might give you some idea about what I am talking => http://stackoverflow.com/questions/1965249/how-to-write-java-like-enums-in-c
missingfaktor
A: 

Java's Excellent Concurrency Library.

This is more of a library feature than a language feature but it still gives Java some edge over .NET when it comes to concurrency. (Please note that you can use these libraries from other JVM languages as well.)

missingfaktor
A: 

Anonymous inner classes (instead of closures)

Roman
+1  A: 

Though it's technically a property of the implementation, the outstanding quality of the garbage collector and the fact that memory management usually "just works" even when you care about performance never ceases to impress me.

dsimcha