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 Group Title

what is class declaration and defination in object oriented programming

  • 2 years ago
  • 2 years ago

  • This Question is Open
  1. Chris2332 Group Title
    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

    • 2 years ago
  2. Chris2332 Group Title
    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/

    • 2 years ago
  3. Chris2332 Group Title
    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!

    • 2 years ago
  4. bthemesandtricks Group Title
    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

    • 2 years ago
  5. itsArun Group Title
    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.

    • 2 years ago
  6. ArtiMehta Group Title
    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?

    • 2 years ago
  7. billel Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    what language are you talkig about python or java

    • 2 years ago
  8. bthemesandtricks Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Java

    • 2 years ago
  9. Chris2332 Group Title
    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!

    • 2 years ago
  10. Chris2332 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

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

    • 2 years ago
  11. billel Group Title
    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(){}}

    • 2 years ago
  12. billel Group Title
    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

    • 2 years ago
  13. bthemesandtricks Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    hmm

    • 2 years ago
  14. Chris2332 Group Title
    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!

    • 2 years ago
  15. billel Group Title
    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

    • 2 years ago
  16. Chris2332 Group Title
    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!

    • 2 years ago
  17. billel Group Title
    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

    • 2 years ago
  18. bthemesandtricks Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    So how can I program a bible in Java Programming Language

    • 2 years ago
  19. billel Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    bthemesandtricks can you be more clear ?!!!

    • 2 years ago
  20. bthemesandtricks Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Like a bible software

    • 2 years ago
  21. billel Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

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

    • 2 years ago
  22. ArtiMehta Group Title
    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 ...

    • 2 years ago
  23. bthemesandtricks Group Title
    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

    • 2 years ago
  24. billel Group Title
    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 :)

    • 2 years ago
  25. billel Group Title
    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 ?

    • 2 years ago
  26. Chris2332 Group Title
    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!

    • 2 years ago
  27. bthemesandtricks Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Thanks Man

    • 2 years ago
  28. billel Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    gd lctal

    • 2 years ago
  29. bthemesandtricks Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    kk

    • 2 years ago
  30. billel Group Title
    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");

    • 2 years 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.