Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

java query

  Asked By: Thomas    Date: Aug 15    Category: Java    Views: 507
  

Recently in an interview i was asked

Why java is not 100% oops?

can any one help me in this regard .

Share: 

 

5 Answers Found

 
Answer #1    Answered By: Adanalie Garcia     Answered On: Aug 15

Here I am giving two reasons ----

1. Java supports primitive datatypes like byte,int,char, float,double etc.. In
the case of these primitive datatypes we don't need to creat any object of their
respective classes (e.g Integer,Float,Double etc), we can directly use int x = 0
; float y= 0.0f ; etc. So this goes against the concept of "encapsulation" which
is one of the basic features of OOPS.

2. Java does not support multiple inheritence.

 
Answer #2    Answered By: Ginger Snyder     Answered On: Aug 15

I don't think that multiple inheritence is needed for true OO
programming ...

In fact, for the most part unless the coder is serriously ninja about
the art of programming, they normally totally make totaly ugly
un-readable (to anybody else) code. Not to mention it often falls into
giant pitfalls of re-usability.

 
Answer #3    Answered By: Jimmy Abp     Answered On: Aug 15

> Why java  is not 100%  oops?

It has primitive datatypes in addition to objects.

int a;

is not the same as

Integer a;

 
Answer #4    Answered By: Rickey Scott     Answered On: Aug 15

http://c2.com/cgi/wiki?IsJavaObjectOriented

if you are really interested you can see other peoples arguments.

The argument is totaly religous. Someone should just compaire something
to hitler, or suggest that the nazis would have considered java  OO to be
any more pedantic

 
Answer #5    Answered By: Monique Perry     Answered On: Aug 15

I dont Know what you mean!
having primitive type is for simplicity and Campatibilty with C and
C++;
you can cast your primitive to object form ver easy to have a better
Control on those data type and having lots of related methods.
how ever in jdk 1.5 you you hava never need casting.
type casting is automatic and the statements like

int i1 = 5;
Integer i2 = new Integer();
i2 = i1;

are absolutly legal whit no error.

Something that no others programming language have and I know they
wont have this facility soon.

 
Didn't find what you were looking for? Find more on java query Or get search suggestion and latest updates.




Tagged: