what is meant by OOP in JAVA?
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.
294017
KajaK is wrong in conception.\nConceptually in Java constructor is not a method or function. It is an elemnt of class like feild or method.\nFunction and constructor both can be oveloded. And effect is somehow simmilar.\nBut constructor is not a method, it is not inherited, and when working with reflections these are treated differently.
598400
There are in fact two types of inheritance in Java:\n - Interface implementation:\n. . . . A Class inherits the method signatures and constants in any interface it implements\n - Class extension:\n. . . . A Class can extend one other class (or an interface can extend one other interface)
1030688
The object oriented programming will give the impression very unnatural to a programmer with a lot of procedural programming experience. In Object Oriented programming Encapsulation is the first pace. Encapsulation is the procedure of covering up of data and functions into a single unit (called class). An encapsulated object is often called an abstract data type. In this article let us see about it in a detailed manner. \n\nThe need of encapsulation is to protect or prevent the code (data) from accidental corruption due to the silly little errors that we are all prone to make. In Object oriented programming data is treated as a critical element in the program development and data is packed closely to the functions that operate on it and protects it from accidental modification from outside functions. \n\nEncapsulation provides a way to protect data from accidental corruption. Rather than defining the data in the form of public, we can declare those fields as private. The Private data are manipulated indirectly by two ways. The first method is using a pair of conventional accessor and mutator methods. Another one method is using a named property. Whatever be the method our aim is to use the data with out any damage or change.\n\nusing system;\npublic class Department\n{\nprivate string departname;\n.......\n\n// Accessor.\npublic string GetDepartname()\n{\nreturn departname;\n}\n\n// Mutator.\npublic void SetDepartname( string a)\n{\ndepartname=a;\n}\n\n}\nLike the above way we can protect the private data from the outside world. Here we use two separate methods to assign and get the required data.\n\npublic static int Main(string[] args)\n{\nDepartment d = new Department();\nd.SetDepartname("ELECTRONICS");\nConsole.WriteLine("The Department is :"+d.GetDepartname());\nreturn 0;\n}\nIn the above example we can't access the private data departname from an object instance. We manipulate the data only using those two methods.\n\nProperties are a new language feature introduced with C#. Only a few languages support \nthis property. Properties in C# helps in protect a field in a class by reading and writing to it. The first method itself is good but Encapsulation can be accomplished much smoother with properties.\n\nusing system;\npublic class Department \n{\nprivate string departname;\npublic string Departname\n{\nget\n{\nreturn departname;\n}\nset \n{\ndepartname=value;\n}\n}\n}\npublic class Departmentmain\n{\npublic static int Main(string[] args)\n{\nDepartment d= new Department();\nd.departname="Communication";\nConsole.WriteLine("The Department is :{0}",d.Departname);\nreturn 0;\n} \n}\n\nFrom the above example we see the usage of Encapsulation by using properties. The property has two accessor get and set. The get accessor returns the value of the some property field. The set accessor sets the value of the some property field with the contents of "value”. Properties can be made read-only. This is accomplished by having only a get accessor in the property implementation.
674839
"this" means the current object, the specific instance we are currently running a method on.\n\nFor example, if we have an object called Cat and a property called furColor, we could assign that property within a class function like:\n\nthis.furColor = WHITE\n\nMeaning: for this instance of a Cat, set the furColor property to white.
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.
67281
I'm not exactly sure what you mean?\n\nAre you trying to run a Java application and the main method can not be found?\n\nIs there a specific error message you are seeing that you can add to the details of this question?
620566
Yes. It is similar. However, OOP has built in support for DE, DA, PM, and so on. You can simulate it in traditional programming methods. You get to see that OOP is supported by OOP languages and tradionational languages can be used to simulate OOP.
390812
OOP: OBJECT ORIENTED PROGRAMMING.\n\nThe whole idea of OOP is to be able to encapsulate data and methods (or member functions as they are called) to protect them.\n\nThis is done by creating a class and letting your class hold information. Then you can just reference the class in any program and use its functionality. This makes for a powerful programming capability and also promotes code reuse. often times you can just reuse an entire class or even use a class after you have modified it a bit. The .NET framework is based on this idea of using various classes to build applications rapidly.\n\nI'd suggest you pick a book up on C++ the one i've used for many years is C++ how to program by Deitel and Deitel. They should have an elaborate section on Classes and Inheritance and the whole OOP&D subject in general.
109898
Another tip - class names and file names are CASE SENSITIVE.  If you create a class "Apple", and refer to it as "apple", you won't find it at runtime.\n\n(I'm just beyond a novice at Java - hope this helps too - just vote for the other guy).
89402
Code:\npublic class BTNode \n{\n    private Object data;\n    private BTNode left, right;\n    public BTNode(Object initialData, BTNode initialLeft, BTNode initialRight)\n        { \n            data = initialData;\n            left = initialLeft;\n            right = initialRight;\n        }\n    public BTNode()\n            { this(null, null, null); }\n    \n    public BTNode(Object newdata)\n            { this(newdata, null, null); }\n    \n    //NODE methods\n    public Object getData()                     //return and set data in node\n            {return data;}\n    \n    public void setData(Object data)\n            {this.data = data; }\n    \n    public BTNode getLeft()                 //return and set left child\n            {return left; }\n    \n    public void setLeft(BTNode left)\n            {this.left = left; }\n    \n    public BTNode getRight()                //return and set right child\n            {return right; }\n    \n    public void setRight(BTNode right)\n            {this.right = right; }\n    \n    public boolean isLeaf()                 //return true if this is leaf node\n            {return (left == null)&&(right == null); }\n \n// TREE Methods - for tree starting at this node\n// get specific data from a tree\n    \n        public Object getLeftmostData()\n        { if(left == null)\n               return data;\n          else \n              return left.getLeftmostData(); }\n        \n        public Object getRightmostData()\n              { if(right == null)\n               return data;\n          else \n              return right.getRightmostData(); }\n// print data in a tree\n        public void inorderPrint()\n                {\n                    if (left != null)\n                        left.inorderPrint( );\n                    System.out.print(data+"&#92;t");\n                    if (right != null)\n                        right.inorderPrint( ); }\n        \n        public void preorderPrint()\n                {\n                    System.out.print(data+"&#92;t");\n                    if (left != null)\n                        left.preorderPrint( );\n                    if (right != null)\n                        right.preorderPrint( ); }\n        \n        public void postorderPrint()\n                {\n                    if (left != null)\n                        left.postorderPrint( );\n                    if (right != null)\n                        right.postorderPrint( );\n                    System.out.print(data+"&#92;t"); }\n        \n// pretty print a tree\n        //public void print(int depth);\n \n//Interface for Nodes in Binary Tree (3)\n//removing nodes from a tree\n//returns reference to tree after removal of node\n        public BTNode removeLeftmost()\n              {\n                    if (left == null)                               // we are as deep as we can get\n                        return right;                               // remove this node by returning right subt ree\n                    else\n                        {                                           // keep going down recursively\n                            left = left.removeLeftmost( );\n                                                                    // when done, return node that act ivated this\n                                                                    // method as root of t ree\n                            return this; }}\n        \n        public BTNode removeRightmost()\n        {\n                    if (right == null)                               // we are as deep as we can get\n                        return left;                               // remove this node by returning left subt ree\n                    else\n                        {                                           // keep going down recursively\n                            right = right.removeRightmost( );\n
4077
There are many more complex answers to this question, and for ones that illustrate the capabilities of Python as an OO language, see the links below. \n\nBut this will work:\n\n#!python\nprint "Hello world."
382095
java usees wrapper classes...Byte,Integer..they are in java.lang package..\n\nin each such class there is one memeber \nstatic int SIZE\n\nusing that u can find out..\n\neg.System.out.println(Byte.SIZE);\n//The number of bits used to represent a byte value in two's complement binary form\n\nSIMILARITY FOR OTHER DATA TYPES..\n\ncheck out documentation site..or if u have already downloaded doc..then use that..
97366
OOP - Functional\n\n# Structured programming - compared to Unstructured programming\n# Imperative programming, compared to Declarative programming\n# Message passing programming, compared to Imperative programming\n# Procedural programming, compared to Functional programming\n# Value-level programming, compared to Function-level programming\n# Flow-driven programming, compared to Event-driven programming\n# Scalar programming, compared to Array programming\n# Class-based programming, compared to Prototype-based programming (within the context of Object-oriented programming)\n# Constraint programming, compared to Logic programming\n# Component-oriented programming (as in OLE)\n# Aspect-oriented programming (as in AspectJ)\n# Rule-based programming (as in Mathematica)\n# Table-Oriented Programming (as in Microsoft FoxPro)\n# Pipeline Programming (as in the UNIX command line)\n# Post-object programming\n# Subject-oriented programming\n# Reflective programming\n# Dataflow programming (as in Spreadsheets)\n# Policy-based programming\n\nTry those links too.\nIf you want anything more specific ask
1066843
I'm assuming you're asking from a Java point of view, so I'll answer along those lines.\n\nAn interface defines a set of methods clustered around common theme. It provides no implementation at all. When a class "implements" an interface, it must provide an implemenation for each method defined in the interface.\n\nAn abstraction (or abstract class) also defines a set of methods clustered around a common theme. The main different is that the abstract class may have implemenation provided behind some or all of the methods, although it does not need to.\n\nIn Java, a class must extend exactly [abstract] class. If not specified, then Object is defaulted as that extended class.\n\nA class may implement as many interfaces as it wishes.
587233
More details pls.\nGo to the source:\nhttp://www.java.com/en
856966
method is like a function if you familiar with c or c++.\nMethod is called like a function the same way you did in c or c++\nMethod in class is a method which associates with its data and other members like functions, objects, etc.\n\nWhile object method is a method which is invoked or called by the object as a referrence. It can also calls a method from another class, depending on your hierarchy, where the other class must either be on top(base class) or same level or at the bottom as long as it has the linkage. To do this, u must use a polymorphism technique (which mostly learn at the institute).\n\nPlease refer to the reference book for this --I'm out of my memory for this!! I've been graduated for a long time ago:)\nBut if you have a technical problem to be solved, you can ask me.\nThis is my email:-> k_mz79@yahoo.com