Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference

 
Ammar dobaee
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i am a java tyro, and i need to know how Encapsulation and Abstraction are different from each other and if no , why?
with thanks,
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

I don't know what a "tyro" is, but this sounds like a homework question. Why don't you tell us what your best answer is, and we'll help you refine it.

I'm guessing you have some sort of Java book (with an index). If not, searching the internet for these words should get you started.
[ December 29, 2007: Message edited by: marc weber ]
 
Ammar Salem
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I still yet, dont know which one is Hiding details and which one is providing details, Encapsulation and Abstraction, i read a book which says "Encapsulation is Information Hiding, yet another book Says its providing,and vise versa, if both exhibit the same actions then why not using only one?? for Instance Encapsulation only !!
please, Ranchers i need your help !!
thanks
 
Ammar Salem
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
marc weber ammar dobaee is now TheOldMan Loves Java
waiting for reply,
thank you
 
Ammar Salem
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And by the way a tyro means Beginner !!!
love,
 
Campbell Ritchie
Sheriff
Posts: 48453
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by TheOldMan Loves Java:
marc weber ammar dobaee is now TheOldMan Loves Java
waiting for reply,
thank you
I trust you saw the naming policy when you signed up; you will have to change your display name to match.

And please wait for longer than two minutes before you say things like "waiting for reply."
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by TheOldMan Loves Java:
marc weber ammar dobaee is now TheOldMan Loves Java
waiting for reply,
thank you

"TheOldMan Loves Java,"

Welcome to JavaRanch!

Please revise your display name to meet the JavaRanch Naming Policy. To maintain the friendly atmosphere here at the ranch, we like folks to use real (or at least real-looking) names, with a first and a last name.

You can edit your display name here. Thank you for your prompt attention!

-Marc
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by TheOldMan Loves Java:
...i read a book which says "Encapsulation is Information Hiding, yet another book Says its providing,and vise versa...

I think "hiding" and "providing" can go hand in hand. Encapsulation primarily involves hiding and protecting data by making fields private. But if there's a need for that data to be accessible, then it's also about providing information through non-private "getter" methods. For example...

Here are some good starting points:
  • Wikipedia - Encapsulation
  • Wikipedia - Abstraction (especially the subtopic, Abstraction in object oriented programming, which relates back to encapsulation)

  • [ December 30, 2007: Message edited by: marc weber ]
     
    Ammar Salem
    Ranch Hand
    Posts: 60
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thank you everyone, for letting me know about the naming policy, i was not really aware, now my screen name involves my real name.
    thank you again,
    looking forward for your kind help in learning java.
    thank you
     
    Raghavan Muthu
    Ranch Hand
    Posts: 3381
    Mac MySQL Database Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Ammar Salem:
    Thank you everyone, for letting me know about the naming policy, i was not really aware, now my screen name involves my real name.
    thank you again,
    looking forward for your kind help in learning java.
    thank you


    That's great. That's what the people here are for!
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic