Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

tendaipaswavairi

what is class declaration and defination in object oriented programming

  • one year ago
  • one year ago

  • This Question is Open
  1. Chris2332
    Best Response
    You've already chosen the best response.
    Medals 0

    I think you could start by reading more generally about object oriented programming. You can use the following link: http://en.wikipedia.org/wiki/Object-oriented_programming

    • one year ago
  2. Chris2332
    Best Response
    You've already chosen the best response.
    Medals 0

    This might be helpful as well: http://docs.oracle.com/javase/tutorial/java/concepts/

    • one year ago
  3. Chris2332
    Best Response
    You've already chosen the best response.
    Medals 0

    Finally, if you fancy reading: http://www.codeproject.com/Articles/22769/Introduction-to-Object-Oriented-Programming-Concep Apologies for the multiple posts... just looking around and posting!

    • one year ago
  4. bthemesandtricks
    Best Response
    You've already chosen the best response.
    Medals 0

    You can also check out this pdf. its all about oop (object oriented language) http://www.mathworks.com/help/pdf_doc/matlab/matlab_oop.pdf

    • one year ago
  5. itsArun
    Best Response
    You've already chosen the best response.
    Medals 1

    In general, declaration instructs compiler that such a class(in general type) exists. Definition allocates memory when an object is created using the class. ex: int i; // this is both declaration and definition Person P; // Assume Person as class, then this is also declaration and definition. extern int i; // just a declaration. The variable is defined elsewhere extern Person P; // just a declaration. The variable is defined elsewhere Hope this helps.

    • one year ago
  6. ArtiMehta
    Best Response
    You've already chosen the best response.
    Medals 0

    @itsArun - why is int i both declaration and definition whereas extern int i just a declaration?

    • one year ago
  7. billel
    Best Response
    You've already chosen the best response.
    Medals 0

    what language are you talkig about python or java

    • one year ago
  8. bthemesandtricks
    Best Response
    You've already chosen the best response.
    Medals 0

    Java

    • one year ago
  9. Chris2332
    Best Response
    You've already chosen the best response.
    Medals 0

    extern is a C/C++ keyword. @istArun I think you have confused the declaration, the definition and the instantiation of classes and what you wrote is not particularly helpful, rather than confusing!

    • one year ago
  10. Chris2332
    Best Response
    You've already chosen the best response.
    Medals 0

    On a side note, don't confuse primitive types with classes!

    • one year ago
  11. billel
    Best Response
    You've already chosen the best response.
    Medals 0

    so simple a class is a couples of objects , so class al last have one object to start over and called as a class . the definition in programming is simple start write public class simpleclass { simpleclass(){}}

    • one year ago
  12. billel
    Best Response
    You've already chosen the best response.
    Medals 0

    huh class don't have premitive type it has others definition or others type like protection type , like an abstract class or an interface class , but premetives is just for variables

    • one year ago
  13. bthemesandtricks
    Best Response
    You've already chosen the best response.
    Medals 0

    hmm

    • one year ago
  14. Chris2332
    Best Response
    You've already chosen the best response.
    Medals 0

    In java: Definition of class: public class Bicycle { // the Bicycle class has // three fields public int cadence; public int gear; public int speed; // the Bicycle class has // one constructor public Bicycle(int startCadence, int startSpeed, int startGear) { gear = startGear; cadence = startCadence; speed = startSpeed; } // the Bicycle class has // four methods public void setCadence(int newValue) { cadence = newValue; } public void setGear(int newValue) { gear = newValue; } public void applyBrake(int decrement) { speed -= decrement; } public void speedUp(int increment) { speed += increment; } } Declaration of the above class: Bicycle myBicycle; Instantiation of the above class: Bicycle myBicycle = new Bicycle(1, 0, 1); // You pass the required parameters to the constructor. It can be done in two steps but it's a matter of style: Bicycle myBicycle; myBicycle = new Bicycle(1, 0, 1); Hope that makes things clear!

    • one year ago
  15. billel
    Best Response
    You've already chosen the best response.
    Medals 0

    Chris2332 why you used to write that Bicycle myBicycle; myBicycle = new Bicycle(1, 0, 1); you can just write Bicycle myBicycle = new Bicycle(1, 0, 1); and her you will win a line

    • one year ago
  16. Chris2332
    Best Response
    You've already chosen the best response.
    Medals 0

    Just said that it can be done in two steps if you want and it is just a matter of style! One line is perfectly fine!

    • one year ago
  17. billel
    Best Response
    You've already chosen the best response.
    Medals 0

    hh Chris you right i think you have also an advancer java and that's good i have done that's ps just in case you will passed some certificat as OCJP bcz that line will matter hh

    • one year ago
  18. bthemesandtricks
    Best Response
    You've already chosen the best response.
    Medals 0

    So how can I program a bible in Java Programming Language

    • one year ago
  19. billel
    Best Response
    You've already chosen the best response.
    Medals 0

    bthemesandtricks can you be more clear ?!!!

    • one year ago
  20. bthemesandtricks
    Best Response
    You've already chosen the best response.
    Medals 0

    Like a bible software

    • one year ago
  21. billel
    Best Response
    You've already chosen the best response.
    Medals 0

    i didn't get it yet ? explain plz tell more detaills

    • one year ago
  22. ArtiMehta
    Best Response
    You've already chosen the best response.
    Medals 0

    I am making an attempt to answer this question though being a beginner myself. REQUEST ALL EXPERTS here to correct immediately if it is wrong. My explanation may not use technical jargons as I am very new to programming. Class can be compared to a template whereby you define basic features/attributes for any Object you wish to create from it in the future. Thus Class definition is defining what all basic features/functionality you wish to have in your future object derived from it. Something like a blueprint from which you will create real thing going forward. For e.g. Class Automobile can have attributes like Colour, Door, Engine, etc and Functions like "StartTheCar"", "ReverseTheCar", "StopTheCar" etc which defines what all the automobile can do. Class Declaration is using the template you just defined. i.e. declaring an object of class Automobile. So this could be any car such as Merc, BMW, or XYZ ...

    • one year ago
  23. bthemesandtricks
    Best Response
    You've already chosen the best response.
    Medals 0

    Hey billel I want a java code to be able to write a bible software

    • one year ago
  24. billel
    Best Response
    You've already chosen the best response.
    Medals 0

    you totaly right in basic understanding yes that's the general describing not as philosophycs but you right congradulation :)

    • one year ago
  25. billel
    Best Response
    You've already chosen the best response.
    Medals 0

    ok i will help you but what you mean by a bibl softwar ; do you mean by that a simple oftwar guid you to others softwar like a small refferance for web sites ?

    • one year ago
  26. Chris2332
    Best Response
    You've already chosen the best response.
    Medals 0

    @bthemesandtricks I think you are not in the correct forum to be asking for java code. You could try http://www.coderanch.com/ and similar websites!

    • one year ago
  27. bthemesandtricks
    Best Response
    You've already chosen the best response.
    Medals 0

    Thanks Man

    • one year ago
  28. billel
    Best Response
    You've already chosen the best response.
    Medals 0

    gd lctal

    • one year ago
  29. bthemesandtricks
    Best Response
    You've already chosen the best response.
    Medals 0

    kk

    • one year ago
  30. billel
    Best Response
    You've already chosen the best response.
    Medals 0

    @bthemesandtricks if ( you need help == true ) System .out .println(" we will help you anyway");

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.