Questions tagged as 'java'

1
answer

Converting TextView value to double

Good afternoon, in my project I'm having the following problem. At the same time there is an activity in which products are added. To add a product, fill in the Name, Quantity and Unit Value fields. The quantity and unit value fields are multipl...
asked by 02.04.2017 / 19:11
2
answers

How do I rotate an arrow within a circle using Java2D?

Previously, I asked " How to draw an arrow using Java2D? and now with the arrow drawn correctly and positioned within my circle, I would like to have the arrow turn inside the circle so that the center of the circle is the fixed reference point...
asked by 10.10.2017 / 13:39
1
answer

Is it possible to compile an app using Java and Kotlin together?

Can I be part of the code in Java and elsewhere with Kotlin? Can anyone tell me?     
asked by 22.03.2018 / 23:03
2
answers

Error with arrays in Java

Could someone tell me what's wrong with this code? The result is always the 1st number before space, but it has to be the sum of all the numbers in the array. import java.util.Scanner; public class Main { public static void main(String[] args...
asked by 05.08.2015 / 01:09
1
answer

How to have multiple addresses in a person class?

If a person has more than one address. Is the code below correct? public class Pessoa implements Serializable { private static final long serialVersionUID = 1L; private int codigo; private String descricao; private String data...
asked by 06.08.2015 / 04:46
1
answer

How to read integers with Scanner and handle invalid entries

I have the following program, where I need to read an integer, print it to System.out However, in my code, when the program receives an invalid value as a String, I want to report the error to the user and still expect to receive an in...
asked by 30.06.2015 / 16:58
1
answer

Get EditText value from a layout passed as parameter to an AlertDialog.Builder at the click of the button?

I use LayoutInflater in my view - View view = li.inflate(R.layout.alertdialog, null); I created an AlertDialog.Builder builder by setting the view, and the positive and negative buttons. My Layout has an EditText and I want to get the val...
asked by 06.02.2014 / 23:22
1
answer

Error while running program: Unsupported major.minor version 52.0 [closed]

While running my program I'm getting this error: Exception in thread "main" java.lang.UnsupportedClassVersionError: TestaContador : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang....
asked by 13.12.2015 / 17:42
2
answers

Static string being created with wrong encode

Hello, When creating a string in a Java class (for example: String t = "Ola Java!" ), it seems the compiler is choosing the 'wrong' encode to interpret the bytes that are in the source and generate the String (the 'right' encode should...
asked by 30.03.2014 / 19:10
2
answers

How to get a Date String?

My question is how to get a string and manipulate it. The user will enter dd / mm / yyyy in the form of String . How do I do this capture? And then I need to turn that date into an integer so I can do the validations, such as if the repo...
asked by 24.02.2015 / 19:20