Most voted "oop" questions
Object orientation is a paradigm of analysis, design and programming of software systems based on the composition and interaction between several units of software called objects.
Learn more…1,456 questions
Sort by count of
-
0
votes1
answer826
viewsModal Bootstrap data insertion with PHP OO
I am developing a client registration screen with PHP OO but due to my inexperience I am finding it difficult to list client data within a Modal Bootstrap. First, I have this list of Client Objects…
-
0
votes0
answers228
viewsLogin User PHP
I’m making the following code PHP public function Login($uname,$umail,$upass) { try { $stmt = $this->conn->prepare("SELECT usersid, user, email, password FROM user WHERE user=:uname OR…
-
0
votes1
answer95
viewsDoubt about object orientation in Python
I’m a classmate we were doing a script I wrote my script in this way: detalhes = programa.duracao if hasattr(programa, 'duracao') else programa.temporada In my case, I’m calling it that way! My…
-
0
votes0
answers37
viewsForce a class to have an attribute
I am doing a project and I need a parent class (heritage) to force its daughter classes to have a certain attribute. It is possible to do this?
-
0
votes2
answers524
viewsPost Ajax for Class PHP
I have the following code that saves reordering a list. INDEX.PHP <?php require_once ("Class.Drag.php"); $auth_task = new Drag(); $list_order = strip_tags($_POST['list_order']);…
-
0
votes1
answer33
viewsKeywords As and Is in C#
Well... I was a little confused about the keywords As and Is in C#... I didn’t understand the difference between them nor what they are for... I believe that it is not so difficult to find a…
-
0
votes1
answer121
viewsHow to differentiate static types from dynamic types?
all right with you guys? I had another OOP class today, and today’s topic was the beginning of substitution and the static and dynamic types. I did not understand the definition of these concepts…
-
0
votes2
answers412
viewsObjects and Memory Permanence in PHP
It is possible to keep objects in memory during a session in PHP or you need to use the "Session" variable to store the previously instantiated objects? The goal is to create a web system similar to…
-
0
votes0
answers74
viewsJAVA Application jumps commands
When I choose case 1, it works ok. But if you choose this option again, the console shows the menu, as if the option did not work. Is there any error visible in this code? { import…
-
0
votes1
answer185
viewsValidate email in JAVA memory
In java, how do I check if the String the user typed has the character "@" or ends with ". com" or ". br" to validate the email in memory ?
-
0
votes1
answer63
viewsNumber of attributes in a Python class
Is there any "rule"/convention for the amount of attributes in a class? Example: In a game, a Character(class) has more than 30 attributes between name, level, strength, etc. With all the attributes…
-
0
votes3
answers579
views3 java classes, one calling the other, how to call first-to-last methods? (bluej)
I have 3 classes, they are: rental, cars, and customer. Rental contains cars, and customer contains rental. If I want to, in customer class, call one of the car class methods, how do I do? For…
-
0
votes0
answers109
viewsJava Calendar class
Good afternoon! The need arose to create a class that receives two dates in my activity, to make the code less dirty. I did some research and found the Calendar class, but I didn’t fully understand…
-
0
votes1
answer38
viewsreceive an object in a method of the same type as the method class
I’m passing a java code to python and came across it(cutting a few parts) public class TreeNode { public TreeNode(TreeNode pai) { how do I receive the father of the type Treenode in python? class…
-
0
votes1
answer38
viewsGet Selected Index
Good afternoon. I want to set the option of a Jcombobox field as the registered option in a given vector position. For a previous text field, I made the following settings:…
-
0
votes3
answers261
viewsCRUD Object Oriented Programming
I’m a little confused about how we persist in an object-oriented programming structure, I’m not sure how to explain it, let’s imagine the object Person and for example through Heritage create the…
-
0
votes1
answer55
viewsChange object data that is in a list
In my application, there is a chained list of elements. I need to perform an operation to change a data of the chosen element. The question is: can I do in this way as I did below searching for the…
-
0
votes1
answer56
viewsHow to avoid the intersection of 2 objects
I have a game problem I’m developing. The problem is, I’ve got two planes that can stand on top of each other and I don’t know what to do, any suggestions? Plane code1 int vBola=550; int CBola=600;…
-
0
votes1
answer37
viewsI need to modify the action taken when closing a Jframe
I am developing an application with persistence in Java for a college job, and I need the system to automatically save the data when closing the application (with a ready function provided by the…
-
0
votes0
answers24
viewsHelp with system change with less work
I have a product list: CREATE TABLE produtos ( idProduto int(2) unsigned NOT NULL AUTO_INCREMENT, tipo enum('m','p') NOT NULL, modelo varchar(100) NOT NULL DEFAULT '', bandejas enum('1','2') NOT…
-
0
votes1
answer72
viewsCalling one class within another
I am using classes within classes and wanted to know if I can instantiate the second class in the constructor of the first. It works and I didn’t notice any problems related to performance, but I…
-
0
votes0
answers472
viewsSend e-mail function mail() using UOL Host
I have the following e-mail class class EmailEnviarDao { public function __construct() {} public function enviaEmail($email) { $cabecalhos = 'MIME-Version: 1.0' . "\r\n"; $cabecalhos .=…
-
0
votes1
answer110
viewsWhy is one method that uses polymorphism being called in place of another in case of inheritance?
Could someone explain why the output of the program is: Primate walking Mammal listening Man seeing. Shouldn’t be?: Primate walking Mammal listening Mammal selling Year: 2019 Banking: IDECAN Organ:…
-
0
votes2
answers1100
viewsHow does the Laravel Model Save method work?
Saving: var $newOs = new OS; $newOs->date = date; $newOs->name = name; $newOs->Area = area; $newOs->save(); Note that on the last line is the $newOS->save, in which no parameters are…
-
0
votes1
answer395
viewsTreat Inputmismatchexception calculator
I am making a calculator in java oo, and I would like to treat this exception but I don’t know how. This is the main class. public class Principal { public static void main(String[] args) {…
-
0
votes1
answer48
viewsWhy are object orientation codes different from structural ones?
I see identical codes that do the same thing, both work on structural and in the POO (object-oriented programming), but object-oriented is different from structural programming. For example, in my…
-
0
votes3
answers617
viewsMove image to another form by clicking the c# button (Visual Studio)
I’m making a parking system, in which arose the need for when the user register, in the main form appear to an icon of a car on top of his vacancy (which is a label), ie when he click the 'register'…
-
0
votes2
answers333
viewsWhat is and what is an override (method override) for in programming?
The title of the question basically says it all: what is and what is a Override (method envelope) in the programming?
-
0
votes1
answer61
viewsInstantiating multiple objects
I’m trying to instantiate an object multiple times, from a single class, defined below: class lancamento(): def __init__ (self,date,description,value): self.date=date self.description=description…
-
0
votes2
answers101
viewsMVC desktop - where is the Controller?
I modified it this example of MVC to try to make it more like my MVC vision (in which the role of the Controller is not very clear). I ended up with a program that only has Views and Model, without…
-
0
votes1
answer53
viewsgetter-Setter error #python
I wonder where is the error in this supposedly simple code class Nome: def __init__(self,nome,sobrenome): self.__nome = nome # variável privada self.__sobrenome = sobrenome # variável privada…
-
0
votes0
answers80
viewsAdd PHP Meta Fractal
I’m using the fractal next to the Laravel to manipulate my collections. In some Transformers I use the available include (as an example below). What I’d like to do is include a goal with array of…
-
0
votes1
answer515
viewsCapture return of a Webservice
I managed, via PHP to connect to a Webservice via SOAP, but I can not caputrar the return data. I made a var_dump in the return variable, and what is displayed on the screen follows below:…
-
0
votes1
answer164
viewsWhy is there so much talk about security in targeted programming?
I program in C and now I decided to explore the world of POO through the C#language. I see that many people talk about security and this is precisely my doubt, when programming I see that the…
-
0
votes1
answer69
viewsKeyboard condition
I am wanting to make a condition through the keys that the user press. For example, if it press 'ENTER' the script continues and press 'ESC' the script to. I searched the internet but found nothing…
-
0
votes1
answer191
viewsAvoid memory leakage in return function
There is an exercise in the C++ book that asks you to create a function that returns an object avoiding memory leakage. I did so but I’m not sure if it really works: class Point1{ public : int x;…
-
0
votes1
answer55
viewsRelationships between classes in the OO
For example, if I have a class Hospedagem and a class NotaFiscal, a lodging has a invoice and a receipt has a lodging. I need to put the attributes inside the two classes, the attribute NotaFiscal…
-
0
votes1
answer96
viewsHow to recover data from model?
I’m using routing with Drouter and always need to take the data of such store by Slug, for this I need to do 1 select on all routes. But I don’t know how to get the id, name and Slug from over…
-
0
votes0
answers19
viewsWhat is the relationship between EER and objects?
The EER (Enhanced Entity-Relationship) model has some concepts such as class, subclass, generalization, specialization. What is the relationship between these EER concepts and object orientation?…
-
0
votes0
answers10
viewsWhat can determine whether a class relationship is strong or weak?
In this case, I am using c# and learning POO, so I would like to know the answer to this question: What can determine whether a class relationship is strong or weak?
-
0
votes1
answer57
viewsInclude Button
Good evening, I’m doing a TCC project, and I was wondering which function I can use on the buttons + and -. The idea is a request app, where when you click on + an item will be added, and when you…
-
0
votes1
answer74
viewsInsert multiple rows of a single query using FOR
I’m trying to input a lot of data using FOR but it’s not working. The impression is that he is not getting the data from FOR? The expectation is that this happens:…
-
0
votes1
answer32
viewsError :Exception in thread "AWT-Eventqueue-0" java.lang.Nullpointerexception
Well, I’m trying to make a login screen, in which the data are in the database, and if you have the right data as in the bd appears a message to the user, but is giving error. The Login page: import…
-
0
votes2
answers461
viewsHow to recover the `mysqli->insert_id`from within this function, in addition to the query return?
public function executar($sql){ $con = new conexao(); $con->abrir(); $re = $con->mysqli->query($sql); // Preciso retornar esta informação tambem: $last_id = $con->mysqli->insert_id;…
-
0
votes1
answer73
viewsRelationships between PHP Models
Hello! I am developing a miniframework, for my projects, and tbm create more knowledge about object orientation in PHP I created a MODEL where it is a big part of everything, and my classes extend…
-
0
votes0
answers22
viewsPHP POO-PACKAGE
I could not understand the right encapsulation, in fact, not the concept, I have difficulty understanding the use of it in day to day, I am seeing the cursoemvideo and not entering much.
-
0
votes1
answer44
viewsWhy isn’t to_s being overwritten?
In Ruby you can override methods, even "default" language classes. I just wanted to know why the code I did below does not overwrite properly. class Oi end class Ola def to_s puts "Olá!" end end oi…
-
0
votes0
answers38
viewsAre there Patterns shared between functional and object-oriented paradigm?
Desing Patterns is a subject that has strong appeal to object orientation. We can hardly see in the literature these subjects associated with another paradigm. However, in version 16.8 of React came…
oop pattern-design software-engineering functional-programmingasked 3 years, 10 months ago Paulo Sérgio Duff 1,201 -
0
votes1
answer60
viewsPrivate encapsulation in inheritance
The class SuperSuper has an attribute of type private defined whole. Any specialization of the class SuperSuper may reset the encapsulation to public and your data is automatically converted? public…
-
0
votes0
answers18
viewsGood evening, can anyone tell me what’s wrong with this media program?
Giving static class error for some reason, someone can help? class Media{ public int Media(int a, int b){ return (a + b) / 2; } public double Media2(double a, double b){ return (a + b) / 2; } public…