Questions tagged as 'classes'

3
answers

Generate setters only in the class constructor or generate outside the constructor

In Java classes, it is common for to create private attributes and to generate getters and setters for these attributes. But, I read that you can do something a little different: only generate the getters and leave the setters in the...
asked by 08.08.2014 / 15:06
5
answers

How to import a variable inside a function of a class?

I would like to get the $valortotal and take it into a function of a class as can be seen in the example below. Thank you. $valortotal = 15.00; class CreatePaymentRequestLightbox { public static function main() { $pedid...
asked by 19.05.2015 / 22:10
2
answers

Class nested in Java

I need to have nested classes in Java. Why does not the following implementation work? public class A{ private class B{ public B(){ System.out.println("class B"); } } public static void main(String[] ar...
asked by 20.10.2014 / 21:42
1
answer

When does it make sense to only have static methods and attributes in a class?

Studying static methods and attributes in OOP, I came across the following question: why in some codes do we have classes ONLY with static attributes and methods? Is there a design pattern that talks about this? In which cases is this a good...
asked by 22.05.2016 / 22:35
1
answer

Classes that implement interfaces are considered subclasses?

I have an interface Veiculo , a class Peugeot that implements Veiculo . This Peugeot is considered subclass?     
asked by 12.09.2016 / 02:47
1
answer

What are classes, how do you use them, and JavaScript?

I started studying programming and JavaScript for 3 months, but so far only in technique. However, I realized that it is much easier to understand the concept of object orientation. I already know that objects in programming are like real-life o...
asked by 11.10.2014 / 08:44
2
answers

What is the real concept and utility of POCO classes?

I am studying and developing a new project and a little studying about Windows Phone 7.1, I saw that they suggest / indicate the use of POCO classes, for database mapping (It seems to me that Windows Phone 7.1 uses some compact version of EF (...
asked by 17.09.2014 / 20:33
1
answer

How can one CSS style class inherit from another class?

I have a circulo class with several properties: font and shape, etc. and I have another class circulo1 with the size and color property. I have to make several circles of different sizes with the same color and in several different pl...
asked by 17.10.2014 / 09:25
1
answer

Is it correct to create a constructor method in an abstract class?

If an abstract class can not be instantiated, creating a constructor method for this abstract class can be considered as good practice or not? If so, what is the reason for creating the implementation of this method? Here is a snippet of code...
asked by 27.09.2015 / 03:43
3
answers

Refactoring a java class

I have a Java class that contains 1756 lines (obviously it's not all code, there are blank lines, lots of comments and some commented code in case you need it in the future) I'm implementing the MVC structure and this class belongs to...
asked by 22.10.2014 / 12:14