Questions tagged as 'java'

1
answer

How to pass an algorithm as a parameter in java?

I've been doing some time measurements on sorting algorithms, and I've created this method that calculates how long an algorithm takes to sort an array of disordered numbers public static double timeToSelectionSort(Double[] arrayOfNumbers) {...
asked by 23.04.2017 / 03:13
2
answers

How to call a method inside a System.out.println?

Can you call a method within a System.out.println(" "); ? Follow my code: package ExerciciosReferenciaDeObjetos; public class Aluno { private String nome; private int matricula; private float n1,n2,media;...
asked by 13.05.2017 / 22:23
2
answers

Changing Linear Layout Transparency

I have a login screen that has a LinearLayout with transparent blue background. How can I make this LinearLayout with id be translucent? <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas....
asked by 29.08.2017 / 22:34
2
answers

Positioning tabs on top of table using layout manager

I'm having problems positioning components. I have a table, and 3 buttons, and I'm trying to position the buttons above the table centrally. Example: ItriedtouseFlowLayout,andtheresultwasthis:importjava.awt.Dimension;importjavax.swing.JButto...
asked by 03.09.2017 / 02:58
2
answers

Numbers located in odd positions

I should only present the numbers present in the odd positions of the vector, however I'm locked: package pag1; import java.util.Scanner; import java.util.Arrays; public class ex1 { public static void main (String[] args){ Scann...
asked by 03.07.2017 / 07:43
1
answer

Close Dialog after 10 seconds open

I would like dialog to close after 10 seconds. I can only do this by clicking the button. Follow the code. AlertDialog.Builder alert = new AlertDialog.Builder(this); WebView wv = new WebView (this); WebSettings webSettings...
asked by 14.09.2017 / 19:39
2
answers

How to get back from a fragment to an activity?

I created an Activity of type Drawer Navigation and the icons in this Activity have an action that takes me to a fragment. My problem is that I do not know how to go back from a fragment to an activity ... how should I do to go back with the...
asked by 17.02.2017 / 21:19
1
answer

Calendar.MONTH returns incorrect month

I'm developing a method where I can get the date, month, and year to create a security key to connect to the server. But I have already verified the date of my emulator and my cell phone is correct, but the month comes with the previous month....
asked by 21.10.2016 / 23:56
1
answer

What is the function to see the distance from tank to wall in the roboCode?

I'm trying to implement in the soccode of robocode (for those who do not know, follow the link: link ) a means to make the tank continue walking and, from some distance from the wall, try to return. For now this is the code I tried, but I do...
asked by 20.05.2016 / 16:13
2
answers

Comprehensive Entity Enrollment Modeling

I am creating a database modeling in the most comprehensive way possible. The entities are Person, Individual, Legal Entity, Supplier and Customer Below the person entity. I add the person's contact information and address to facilitate futur...
asked by 14.04.2016 / 23:35