Questions tagged as 'java'

1
answer

How to fill an ArrayList with values from another ArrayList randomly picked?

I have class Vetor which will have a method to start a vector with random numbers: public class Vetor{ private int tamanho; private int[] vetor; public Vetor(int tamanho) { this.tamanho = tamanho; this.vetor =...
asked by 13.02.2017 / 15:34
1
answer

Why does the program close when I click the button?

Could someone tell me why the program closes after clicking the button? import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android...
asked by 22.06.2017 / 20:25
1
answer

Error Exception in thread "main" java.lang.NullPointerException

So, I'm trying to make a program that adds 2 vectors via Thread , but it gives the following error:    Exception in thread "main" java.lang.NullPointerException       at Soma (Main.java:37)       at Main.main (Main.java:7) I wante...
asked by 22.08.2016 / 01:17
3
answers

Converts negative number to positive

Is there any native java library that will help me in an elegant way to convert a negative number to a positive number. I did not want to do it this way: public class Main { public static void main(String[] args) { int i1 =...
asked by 15.07.2014 / 23:44
2
answers

How to get the HTML code of a page protected with Cloudflare?

I'm trying to get the HTML of a page with Jsoup . This page has Cloudflare as a protection, and instead of getting the HTML code of the site I'm interested in, you're returning the HTML to the Cloudflare page ( see image below ) that appears...
asked by 18.03.2016 / 00:56
1
answer

compare two objects in java [closed]

Good evening. I'm working with an arraylist, and I had to make sure no duplicate objects were inserted. My object has an array [5] [5] which is the main element that I need to ensure is not repeated. Anyone have any suggestions?     
asked by 14.03.2014 / 01:04
1
answer

How to implement an inputText for "Tags" or "keywords" in Android Studio?

I'm creating an android app and I need a simple inputText that allows the user to type "tags" much like the question field here on the site. How do I implement this? Do I need an external library? I've reviewed everything and no solution worked...
asked by 09.09.2018 / 18:23
1
answer

Setar auto-increment in DBeaver

After creating the idpagamentoCielo column as the primary key, I was not able to add the auto-increment property to the column. How can I assign the auto-increment property to the idpagamentoCielo column? Note:...
asked by 04.09.2018 / 14:55
2
answers

Problems with page transition

I'm trying to create a simple page-changing event when I click the button, but every time I run the application it crashes when it opens. MainActivity: package com.app.agrandesacada; import android.support.v4.app.Fragment; import android...
asked by 30.04.2014 / 01:58
2
answers

What language do you study? [closed]

Next, I'm doing the 2nd semester of the Information System course and I'm in great doubt of which language to devote myself to learning! I would like to know what was the first language you learned and which is the most accepted language in t...
asked by 16.06.2015 / 16:21