top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Is Scala a Pure OOP Language? Is Java a Pure OOP Language?

+1 vote
638 views
Is Scala a Pure OOP Language? Is Java a Pure OOP Language?
posted Sep 30, 2016 by Karthick.c

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes

yes, Scala is a pure object-oriented language in the sense that every value is an object. Types and behavior of objects are described by classes and traits. Classes are extended by subclassing and a flexible mixin-based composition mechanism as a clean replacement for multiple inheritance. . but
Java is not a pure Object oriented language, but so called a "Hybrid" language.
For any language to be pure object oriented it must follow these 6 points strictly...
1) It must have full support for Encapsulation and Abstraction
2) It must support Inheritance
3) It must support Polymorphism
4) All predefined types must be Objects
5) All user defined types must be Objects
6) Lastly, all operations performed on objects must be only through methods exposed at the objects.

Now, java supports 1, 2, 3 & 5 but fails to support 4 & 6.

answer Oct 1, 2016 by Devendra Bohre
0 votes

Pure Object-Oriented Programming Language means that everything should be an Object.

Java is not a Pure Object-Oriented Programming (OOP) Language because it supports the following two Non-OOP concepts:

Java supports primitive data types. They are not objects.
Java supports Static members. They are not related to objects.
Yes, Scala is a Pure Object-Oriented Programming Language because in Scala, everything is an Object and everything is a value. Functions are values and values are Objects.

Scala does not have primitive data types and also does not have static members.

answer Oct 6, 2016 by Shyam
...