Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes difference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "difference" Watch "difference" New topic
Author

difference

Ammar dobaee
Greenhorn

Joined: Dec 29, 2007
Posts: 1
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

Joined: Aug 31, 2004
Posts: 11343

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 ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Ammar Salem
Ranch Hand

Joined: Dec 29, 2007
Posts: 60
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


****************************<br />For Some Dreams.....<br />One Lifetime Is Not Enough.<br />****************************
Ammar Salem
Ranch Hand

Joined: Dec 29, 2007
Posts: 60
marc weber ammar dobaee is now TheOldMan Loves Java
waiting for reply,
thank you
Ammar Salem
Ranch Hand

Joined: Dec 29, 2007
Posts: 60
And by the way a tyro means Beginner !!!
love,
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36599
    
  16
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

Joined: Aug 31, 2004
Posts: 11343

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

Joined: Aug 31, 2004
Posts: 11343

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

    Joined: Dec 29, 2007
    Posts: 60
    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

    Joined: Apr 20, 2006
    Posts: 3344

    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!


    Everything has got its own deadline including one's EGO!
    [CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: difference
     
    Similar Threads
    Posting to bump up my count...
    The x900 effect ?
    WA #1.....word association
    Cant use object from another class
    Text box value is not being completely filled with request attribute