Questions tagged as 'java'

1
answer

Method overload is polymorphism?

I'm having trouble understanding the concept of polymorphism in Java, I've read two articles from the same portal now, and got confused more, because for my interpretation they contradict each other: Excerpt 1:    "Overload is a concept of...
asked by 27.06.2018 / 03:40
1
answer

How to convert String that contains quotes in same string, using replaceAll?

I have a String as in the example below String a = "Meu pai é um Grande "baio" de fada"; I want to make it turn a String like this String a = "Meu pai é um Grande \"baio\" de fada"; How do I do this using replaceAll?     
asked by 24.06.2015 / 21:07
1
answer

What is the need for an interface to have abstract methods?

We know that in an interface the methods have no implementation, just signing, that is, just defining their methods without the body, we conclude that all are already abstract methods, right? But then why are there statements like: interface E...
asked by 03.01.2018 / 02:13
1
answer

Program goes into infinite loop

My goal with the code was to set up a game that asked the person which number the computer would be "thinking" (from 1 to 100), and as the person said a number from 1 to 100, the computer would tell if the random number generated is greater or l...
asked by 03.04.2018 / 02:11
1
answer

"No suitable driver found" in Java database connection

Well, I use eclipse and I'm trying to connect to a MySQL database with my project, my code, compared to other tutorials I found, is perfect, and that's it: package pack; import java.sql.*; import javax.swing.JOptionPane; public class Banco...
asked by 10.06.2014 / 01:49
1
answer

Generate private certificate APK using Eclipse Android

When I click Run in eclipse, it generates the APK, sends and installs it on Android, but it installs using a Debug certificate, I'm using Google Games Services and it only works if the APK has a private certificate which we created to send to Goo...
asked by 30.04.2014 / 05:19
2
answers

Is it possible to pass a method as a parameter to run in a thread?

I have an application where each process is called by a single method and this process needs to be executed on a thread. The threads code is identical in all, changing only the content of the run () method. I would not want to be copying and p...
asked by 31.08.2016 / 08:09
1
answer

Change text and background color ToolTip

How can I change the background color and text of a ToolTip? I already did a search and found here a code snippet but I can not change it. The colors always remain the standard NetBeans. Any suggestions? I put the following code in the cons...
asked by 14.11.2014 / 10:48
2
answers

Syntax error when creating table in PostgreSQL using Hibernate

@Entity public class User { @Id @GeneratedValue private int id; private String name; private String email; private String sex; private int age; private Date birthday; private Date registerdate; private...
asked by 12.11.2014 / 15:20
2
answers

Maximum number of characters in a String and StringBuffer in Java

What is the maximum character limit that String and StringBuffer types support in Java?     
asked by 02.10.2014 / 18:28