Explain the differences between classes and objects.?
595133
A class is a data type that encapsulates data and operations on data in a single unit. Before object-oriented programming, data and operations (functions) were treated as separate elements. An object is an instance of a class. That is, it is a value whose type is a class. The term object is often used more loosely in this documentation and where the distinction between a class and an instance of the class is not important, the term "object" may also refer to a class.\n\nYou can begin to understand objects if you understand Pascal records or structures in C. Records are made of up fields that contain data, where each field has its own type. Records make it easy to refer to a collection of varied data elements.\n\nObjects are also collections of data elements. But objects--unlike records--contain procedures and functions that operate on their data. These procedures and functions are called methods.\n\nAn object's data elements are accessed through properties. The properties of many Delphi objects have values that you can change at design time without writing code. If you want a property value to change at runtime, you need to write only a small amount of code. \n\nThe combination of data and functionality in a single unit is called encapsulation. In addition to encapsulation, object-oriented programming is characterized by inheritance and polymorphism. Inheritance means that objects derive functionality from other objects (called ancestors); objects can modify their inherited behavior. Polymorphism means that different objects derived from the same ancestor support the same method and property interfaces, which often can be called interchangeably.
1015124
The result will be false if the AbstractObject is an abstract class!\n\nThe result will be true if AbstractObject is a concrete class
193431
Probably because the constructor doesn't accept objects as arguments. Just a guess, though.
731947
You need to know what are the elements belong to the class(es). In your case, what are the element belong to Railway Reservation, what are the activities (class functions) involved.\n\nSo basically a class diagram will consists of Class name, attributes, and operations\n\nHave a good look at this link, save me explaining..\nhttp://pigseye.kennesaw.edu/~dbraun/csis4650/A&D/UML_tutorial/class.htm
338060
An instance in Java is referred to the Memory block where the Object variables are placed on the HEAP. \n\nSuppose we have the following Object\n\nClass obj{\nprivate int a;\nprivate int b;\n\npublic int Sum(){\nreturn a+b;\n}\n\n}\n\nnow this Objecet (obj) is instanced as follows\n\npuiblic static void main(String argv[]){\nobj myObj = new obj(); //Creates an instance of obj on the heap\nint a =myObj.Sum();//Call to the sum method of the obj class\n}\n\nWhen a class in instantiated all the PUBLIC methods are in scope of the calling class
1075666
"this" is a reference to the current class or object. It's frequently used in that way:\n\nclass Foo {\n    int x;\n\n    void setX(int x) {\n          this.x = x;\n    }\n}\n\nThis way you can access the field x though it's overridden by the use of the identifier x as a function parameter.
775295
The idea behind an abstract class is that you can't instantiate it. It is a class that is "missing" something.\n\nAre you familiar with how memory allocation works in Java? When a class is loaded the first time it needs to have some tables initialized - for instance, transfer tables for methods, and storage for static variables. Abstract classes are the same as any other class, the tables are initialized. When an object is created the memory is allocated for all its instance variables. Since an abstract class cannot be instantiated, its instance variables are not allocated directly. When a subclass object is created the memory for all superclass objects, including abstract superclasses, is created.\n\nSo it is actually in 2 places, once when the class is initially loaded and once when a subclass is instantiated.
701316
Inner Classes \n\nInner classes let you define one class within another. \n\nThey provide a type of scoping for your classes since you can make one class a member of another class.\n\nJust as classes have member variables and methods, a class can also have member classes.\n\nclass Outer { \n/class Inner { } \n}// End of class \n\nif you compile it,\n%javac Outer.java\n\n\nyou’ll end up with two class files:\nOuter.class\nOuter$Inner.class\n\n\ne.g.\n\nclass Outer { \nprivate int x = 5;\n\npublic void outerMethod() {\nInner in = new Inner();\nin.innerMethod();\n}\n\nclass Inner {\npublic void innerMethod() {\nSystem.out.println("Outer variable x is " + x);\n}\n} \n}// End of class \n\n\nYou can create four different types of inner classes, based upon the how and the where of creation. \nNested top-level classes\nIf you declare a class within a class and specify the static modifier, the compiler treats the class just like any other top-level class. Any class outside the declaring class accesses the nested class with the declaring class name acting similarly to a package. eg, outer.inner. Top-level inner classes implicitly have access only to static variables. There can also be inner interfaces. All of these are of the nested top-level variety.\n\nMember classes\nMember inner classes are just like other member methods and member variables and access to the member class is restricted, just like methods and variables. This means a public member class acts similarly to a nested top-level class. The primary difference between member classes and nested top-level classes is that member classes have access to the specific instance of the enclosing class.\n\nLocal classes\nLocal classes are like local variables, specific to a block of code.Their visibility is only within the block of their declaration. In order for the class to be useful beyond the declaration block, it would need to implement a more publicly available interface.Because local classes are not members, the modifiers public, protected, private, and static are not usable.\n\nAnonymous classes \nAnonymous inner classes extend local inner classes one level further. As anonymous classes have no name, you cannot provide a constructor.
150471
*  Objects...\n          o Autonomous entities\n          o No direct access to their components, or run time type2\n          o Interact purely by messages, with no assumption of implementation \n\n    * Object Organization...\n          o Inheritance mechanism to construct an object classification hierarchy\n          o Not just for code sharing\n          o Must have abstract nodes in hierarchy for more realistic modeling\n          o Provide potential for individuality in objects\n          o Dynamicly determine (via run time type) correct response to messages \n\n    * Programs as Models...\n          o Programs model the development of some planned system\n          o Changing state of system reflected by the changing state of the objects\n          o Objects can be thought of as acting concurrently\n          o Support for ``non OO'' programming techniques in situations where they make sense
345643
Object Oriented Programing is a methodology for programers to build applications with 'Objects'  or structures of code that are classified as 'objects' \n\nexample: \nAn online product, or a site user, or a site page for that matter.. can all be thought of as OBJECTS in code..  \n\nyou can asign them 'Properties' such as the product Price, or the user's FirstName or the Page's URL.. \n\nyou can assign them 'Methods' or functional behaviors such as 'AddTaxToProductPrice()' or 'SignOutUser()' or 'ReBuildPageView()' .. all of which are functions defined by the developer and ORIENTED around the particular OBJECT ... hence Object Oriented ;)\n\nOOP Languages also allow for a host of other cool features such as Inheretance and Polymorphisum.. but you'll have to put in another quarter and ask a second question for that ;) \n\nEyal.
225155
When you declare a object in c++ a constructor(a member function)  is called.\nA C++ class can can have more than one constructor if they \nare not all the same(they must have different parameters)\nWhat constructor is called depends on how you declare the object:\nMyClass x;//Default constructor\nMyClass y(10,50);//A contructor with 2 parameters\n\nHere is how is declare the 2 constructors:\nclass MyClass\n{\npublic:\nMyClass (){}\nMyClass(BYTE a,BYTE b){}\n};
98158
OOP languages have extra language features - e.g. encapsulation, polymorphism, and inheritance are object behaviours that don't have a direct procedural equivalent.\n\nFor making setup files, there are commercial solutions like InstallShield, but for free, consider NSIS: http://nsis.sourceforge.net/Main_Page
593379
what is the difference between the two
800373
Inheritance means you are making the child, aggregation is you are inlcuding it inside. \nconsider \nclass A\n{\n}\n\nclass B :: class A\n{\n}\n\nThis is inheritance. class N has inherited properties from class A.\n\nwhile,\n\nclass B\n{\n  class A classa;\n}\n\nThis is aggregation as class A is now included in class B.
992635
yes its a purely object oriented. Its because pretty much every variable youuse is and object. Even types like String and Integer. There are also many objects already written in java, that java provides, that you can use to create something or inheret it into your own classes and objects. \n\nThere are however some basic types like int (not Integer like above) and double, and boolean.  But majerity of the language is object oriented and almost every object is a subclass of another class. Thats why you end up having to do things like System.out.println. Meaning println is dependent on out, which intern dependent on System. So when writting something you end up having many dependecies and some lines can edn up being quite long.\n\nAnyways, yes, for majority - java is object oriented. Not completely since it still has basic types like int and double.
358642
class Car {\npublic:\nCar();\n~Car();\nvoid Accelerate( float howmuch );\nvoid Brake( float howmuch );\nint Turn( float howmuch );\nint fuel;\n\nprivate:\nint speed;\nfloat accelerate;\nint SubFuel(int qty);\n};\n\nYou should aleady be familiar with the concept of structures (or structs) in C, a structure contains a series of variables which can be used to group data together. A C++ class does much the same thing, except that it not only provides data but also functions to manipulate that data.\nNow let's examine this code line by line. The first line simply says 'I want to define a class called 'Car', the syntax is similar to that used in a struct, except that whenever you wanted to create a variable of type Car you only have to type Car mycar; rather than class Car mycar;. The third line declares all the variables that follow to be 'public'. This means that they can be accessed by any piece of code, for example:\n\nvoid main( void ) {\nCar mycar;\nint fuel;\n\nmycar.Accelerate( 0.5 ); // Note the use of . to access data members and data functions\nfuel = mycar.fuel;// If you had a pointer to a class then you would use ->, as in a struct\n}\n\nNow the forth line is important, it defines a function called 'Car' with no return type. Because this function has the same name as the class it is treated specially, it is called a constructor because whenever a new version of the class is created the constructor is called to initalise the objects data. The fith line is the opposite, because it is the calss name preceded by a ~ symbol it is called the destructor and is automatically called whenever an object is deleted or removed from memory.\nThe next three lines define three member functions, which can be accessed using the '.' method, these have no special meaning and have to be called manually from code (for example on the sixth line of the 'main' example above accelerate is called for the object 'mycar' of type 'Car'). The nineth line declares a meber variable of type int called fuel, this can be treated in much the same way as you treat a struct's member variable.\nThe tenth line is another improtant one, it tells the compiler that the member functions and variables that follow it ar private, meaning that they can only be accessed by the member functions of the class. In this case only the functions Car, ~Car, Accelerate, Brake, Turn and SubFuel would be able to access 'speed' or 'accelerate'. This is also true of the private member function 'SubFuel'. Finally two variables called speed and accelerate and a function calle SubFuel are defined.\n\nYou have seen that a class can contain member variables that can be public or private depending on who you want to be able to access these functions. It is in fact comon to make all member variables private and use functions to Set and Get them because this has the added advantage of enableing you to 'validate' the new data. In addition to public and private data there is also protected data. Protected data is only accessable by the class itself, derivates (see below) of the class and friends of the class. For example, if you had another calss called Driver and you wanted him to be able to access speed then inserting the following code instead of the private block would give driver access to it:\n\nprotected:\nint speed;\nfriend Driver; // make the class 'Driver' a friend, you can also make functions friends\nprivate:\nfloat accelerate;\nSubFuel(int qty);\n\nSo far you have only seen the declaration of the class, you have not seen the implementation of any of the functions. There are two ways to implement the functions, the first is directly into the class - this method is often used if the function is very short:\n\n// A simplified version of the Car class, demonstarting the simple implementation of the Car constructor\nclass Car\n{\npublic:\nCar() {\nfuel = 100;\n}\nprivate:\ni
132213
Object Oriented is one methodology (or way) to design a software application.  By object oriented, it is meant that software modules are designed to resemble the way the world works.  For example, a program module that is used as a bill of lading would be created to keep all the data and functions associated with a real bill of lading.  It would "know" the address to ship to, items on the packing list, address of the shipper and all the other details on a real bill of lading.  It would also be capable of functions called methods that are used to collect, store and pass on this information to entities that need it whether they are human users or other objects in an application that need the information to "be" what they are and do what they do.