• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Why does JavaScript not have Classes like Java ?  RSS feed

 
Ranch Foreman
Posts: 1113
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does JavaScript not have Classes like Java.

Thanks.
 
Marshal
Posts: 67257
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript does have classes. You need to get up to date with the latest versions of JavaScript (EcmaScript 6 and beyond).

That said, the classes aren't identical to Java classes, but I'm pretty sure that's not what you meant. (In which case the question would have been "Why aren't JavaScript classes identical to Java classes?")
 
Bear Bibeault
Marshal
Posts: 67257
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And the pro-active answer in case the question was "Why aren't JavaScript classes identical to Java classes?" is that the classes of any language other than Java are not identical to Java classes; why would JavaScript be any different?
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript is a object oriented language hence it does not need classes.
 
Saloon Keeper
Posts: 5413
143
Android Firefox Browser Mac OS X Safari Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

roshani sen wrote:JavaScript is a object oriented language hence it does not need classes.


There is a strong connection between objects and classes in general, even if they're not named exactly that. Not an absolute one, but as pointed out, JavaScript does have classes. So this statement is incorrect on more than one level.
 
Everybody's invited. Except this tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!