Questions tagged as 'java'

2
answers

Is it possible to return a variable from an object-oriented class without using a function?

I do not know if this possibility exists. Here is a code to help with the question: public class Square { int side; public Square(int side) { this.side = side; } int getArea() { return side * side;...
asked by 18.10.2016 / 16:59
3
answers

Remove from a List of Integers

I have a ImageButton o imgB1 : When I click on imgB1 , I add it to a list of integers, 1. If you re-click the imagB1 , it removes the 1 and places the 6. List<Integer> list = new ArrayList<>();...
asked by 30.01.2017 / 13:29
1
answer

AlertDialog Android "comment" PopupMenu

How do I get this result? The3dotsinthisimagehavealreadybeenpressed.Mylayout<android.support.v7.widget.CardViewxmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:to...
asked by 13.02.2017 / 23:45
1
answer

What do I need to learn specific classes and methods for a task? [closed]

What do I need to learn about classes and methods in general for Java and Android programming? For example, if I need to display a PDF, how will I learn to do this? We know that there are several classes, no one here could write all the cl...
asked by 02.05.2017 / 16:48
2
answers

Format java.time.Duration for String

The code below is producing the following output: Resultado: PT2H30M I would like it to be: Resultado: 2:30 Does anyone know how I can do it? import java.time.Duration; import java.time.LocalDateTime; public class TesteDuration { pu...
asked by 22.01.2017 / 17:01
2
answers

Handle a class of type Object

I have the following very complex situation (at least for me). I have a Person class (Data is fictitious for better understanding, but the idea is the same) like this: public class Pessoa { private int codigo; private String nome;...
asked by 19.01.2017 / 19:16
2
answers

How to create CheckBox via schedule [closed]

How to create multiple Checkbox's via programming?     
asked by 23.01.2017 / 02:13
1
answer

When declaring an interface in the class, who should implement it?

class Gerente extends Funcionario implements Autenticavel { It means that Gerente implements the interface Autenticavel , or Funcionario that will implement the interface?     
asked by 09.09.2016 / 17:17
3
answers

Use of the split method

Good morning, excuse my ignorance by simple doubt. I'll get right to the point. I have a list of alerts List<Alertas> alertas; This list contains several messages sent to some users, I have the following methods that I can use: g...
asked by 15.08.2016 / 14:08
1
answer

Lighter and more stable alternative to Android Studio [closed]

I need to do an Android project, but I do not want to use Android Studio because it is very slow and full of bugs on my computer. Which alternative IDE or framework could I use? A basic requirement of the project is to be in Java.     
asked by 16.11.2016 / 23:42