What is the difference between constructor, method, and object.?
86041
Well, huh.  \n\nOkay, let's say we're making a dog simulator with OOP.  So we might have various "objects" in the game in order to give structure to our program; in this case, "dog" could be a primary object.  But anything that exists in our program would also be an object -- street, fire hydrant, owner, leash, policeman, etc.\n\nOur dog object will have various properties, methods, and events.  Properties are things that describe the object (possibly uniquely), methods are things the object can actually do, and events are things that can happen to the object that it can respond to.  For example, "color" might be a property, "smell(something)" might be a method, and "owner picks up leash" an event.\n\nA constructor is simply the most basic method for any object that actually creates a new unique object.  In this case anytime we define a new dog object we will call the constructor for that object, in which we might set some default properties (ie set color = "black") and call some methods to establish the object within the program framework.  For example, we might use a constructor to register the new dog object in the list of possible "encounter" events that can happen to other dogs.\n\nObviously this is a very basic introduction. The best way to familiarize yourself with OOP is to design a few very very basic programs -- let's say a program that runs a mouse through a maze.  Imagine all the objects, all the properties for those objects, all the methods those objects will have to do, and all the events the objects will have to respond to, and write them all out.  \n\nThen program something yourself in your favorite programming language and find out all the things you forgot to include  :)
587233
More details pls.\nGo to the source:\nhttp://www.java.com/en
458967
Java and javascript both based on objects and their is a tight relation ship between these two.\n\nThe major difference between these two are:\n\n1.Java is compiled language but javascript is an interpreted language.\n\n2.Java is strongly typed language i.e,it is necessary to declare variables before use but it is not the case with javascript.\n\n3.Java is used independently while javascript is used with in html tags and require web browser to run.\n\n4.java files have the file extension of '.java' while javascript files have extension of '.js'\n\n5.Java can be used for designing standalone applications as well as web pages also while javascript can only be used for designing wed pages
108544
Your object will be passed by reference because\nthat's how Java passes all objects.  Only the\nprimitive types like "int" are passed by value.
1081144
A static method does not require an instance of an object (which is why you can't use "this" within it), whereas an instance menthod requires you to have an instance of an object.\n\nFor example, if you have a class called "Person":\n\npublic class Person\n{\n     public string FirstName;\n     public string LastName;\n\n     public string GetFullName()\n     {\n            return this.FirstName + " " + this.LastName;\n     }\n\n     static public string GetFullName(string First, string Last)\n     {\n           return First + " " + Last;\n     }\n}\n\nThe first method is an instance method. You would have to call it using an instance of a Person object:\n\nPerson objPerson = new Person;\nobjPerson.FirstName = "John";\nobjPerson.LastName = "Doe";\nResponse.Write( objPerson.GetFullName() );\n\nThe second method is a static method. You don't need a current Person object to execute it.\n\nResponse.Write( Person.GetFullName("John", "Doe") );\n\n\nStatic methods are helpful for when you don't need to the overhead of instancing an entire object just to perform one menial function.
1131033
The first is a Java Class called Main.\n\nThe second is the constructor for this class. This is what isused to basically set the class up and make an instance of it.\n\nThe third is a method called main which takes in a string array which you have named args. You could call args whatever you want, its juts a general name most coders put on it. It has a modifier which is static and is public so other classes can invoke it. The main method is what is looked for by the java compiler at run time when you execute the program.\nSo a class may look like this:\n\npublic class Main\n{\npublic String greeting;\n\n public Main()\n{\ngreeting = "hello"\n}\n\npublic static void main(String[] args)\n{\nSystem.out.println(args[0]);\nSystem.out.println(greeting);\n}\n}\n\nThis would result in the value stored at args[0] being printed out. Then "hello" printed out on a new line.\nThe args are the arguments that you pass to your program. Most programs take in strings or ints.
29500
I think c is true becuse a varible name can not contain any thing other than lettera and digit if you add _ in letters.\nBut a class may not have constructor when default constructor will be used.
287578
Firstly there's only one java language, which is written with several interfaces, but the java compiler is the same. \nThe syntax in Java is pretty much the same as in C++. The only thing is that Java is fully object oriented while C++ is only partially. Which means that if you write Java code, you have to declare classes, while C++ can run C codes which aren't object orinted, so you can write programs without classes. For VB tutorials try: \nhttp://www.programmingtutorials.com/vbnet.aspx
834258
You probably should be asking what are objects and how can they benefit a programmer?\n\nAn object describes something tangible, and provides you with the possible interactions to that object.\n\nAs an example: If you want to create a telephone object you would create the object and provide all the possible feature that descrivbe the telephone:\n\nColor, Rotary or Button, The Buttons themselves - including hold, redial, whatever extra buttons you want\n\nThe description gets as complicated as your task\n\nThen in the object you provide it with the interactions you want.\nIf you wnat an interaction for each button you can.  Or if you just want interaction with your special buttons and an interaction to Dial a number you can set these interactions up anyway you want.\n\nThe advantage to a programmer:\n1) all code for a phone is in one place.\n2) you can create multiple phone that look and work differently based upon your description:\n\nPhone Rotary = new Phone(true,"Black");\nPhone PushButton = new Phone(false,"White");\nPushButton.HasHold = true;\n\nSince you wrote the code in phone to handle dialing a number you could do:\n\nRotary.Dial("555.123.4567");\nPushButton.Dial("555.123.4567");\n\nIf the dialing feature doesn't work you just go to one place to fix it and you're done.\n\n\nI've been using object-oriented programming for over 5 years, if you want to discuss it more in depth feel free to email me.
640622
Scope is the visibility of a variable, a method, or a property or other member of a class.  \n\nGood programming style will limit scope of variables as much as possible.  For example, a complex algorigthm might have hundreds of lines of code, dozens of variables, complex calculations etc.  But from the outside, calling the method should be as simple as possible.  \n\nResticting scope makes the use of the object or function easier to use, and also protects the variables use internally from misuse, whether unitentional or otherwise.  \n\nIn most languages, varibles can be:\n public (visible and usable by everyone)\n internal (not visible or usable by anyone outside the method or class)\n protected (only visible or usable by derived classes)\n shared (also called static, shared by all instances of a class or method)
528997
Operator overloading is just “syntactic sugar,” which means it is simply another way for you to make a function call.\n\n\nThe difference is that the arguments for this function don’t appear inside parentheses, but instead they surround or are next to characters you’ve always thought of as immutable operators.\n\n\nThere are two differences between the use of an operator and an ordinary function call. The syntax is different; an operator is often “called” by placing it between or sometimes after the arguments. The second difference is that the compiler determines which “function” to call. For instance, if you are using the operator + with floating-point arguments, the compiler “calls” the function to perform floating-point addition (this “call” is typically the act of inserting in-line code, or a floating-point-processor instruction). If you use operator + with a floating-point number and an integer, the compiler “calls” a special function to turn the int into a float, and then “calls” the floating-point addition code.
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.
1127525
- you cannot use new with primitive types\n- primitive types cannot have a null value like object references do\n- primitive types are not derived from java.lang.Object\n- primitive types have no class definition, no members, and no methods\n- as members in objects primitive variables are always Serializable (no need to declare them as such)
713943
The differences between Java and .NET is mostly of the syntax and libraries.\n\nBecause both of them work on same architectural concepts and frameworks.
573652
In structured programming you make functions-sub procedures in a "nested" fashion. Several languages force you to use structured approach. OO languages USE structured programming at their core. The difference might be understood comparing the old BASIC where you wrote things like:\n10 CLS\n20 LOCATE 1,1: PRINT "HELLO"\n30 LOCATE 2,1: PRINT "Enter your name?"\n40 INPUT $NAME\n50 IF $NAME="JOHN" THEN PRINT "Hi, JOHN"\n60 IF $NAME="MARY" THEN GOTO 80\n70 PRINT "Hello, " & $NAME\n80 PRINT "BYE"\nThis is NOT structured... a structured approach would be:\n\nname=readname();\nwrite(name);\ncompare(name,"john")\n\n... and elsewhere you'd define each subroutine (readname, compare...)\n\nIn OOP you'd do something like\nname.compare("john")\n\nwhere name.compare is a function you'll define for the object 'name'.
329175
I'm assuming your accessing it from another class? \n\nPrivate declaration stops this from occuring. You need to provide a public property ie.\n\nprivate _str as string = ""\nPublic Property etc as string\nGet\nreturn _str\nEnd Get\nSet(value as string)\n_str = value\nEnd Set\nEnd Property\n\nOtherwise if you are accessing a class-scope variable normally, you could do:-\n\nPublic class Class1\n Private Str as string = ""\n Private Sub New()\n   Str = "Hehehe"\n End Sub\nEnd Class\n\nQuestion wasn't clearly stated, but i think that should answer it...
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