Why is the "old ()" method only returns the "Are you new" answer, regardless of the age you entered? What is going wrong?
public class Pessoa{
private int idade;
public Pessoa(int idadeInicial) {
if(idadeInicial<0){
idade = 0...
I have a problem with my Android project that I can not resolve. I have a series of strings that are summed to form a larger string as in the following example:
String teste1 = "O.P. Processo Célula";
String teste2...
I declare a method that gets a List of type Object . However, when I try to recognize it with instanceof it gives error. I tried to do a casting but it still gave an error and I could not identify where the problem is in my c...
I started learning Java with Elipse and I am learning more and more. But I came across a situation: when I use system.out.println(""); , Eclipse "says" that there is a syntax error and I have no idea what that can be. I've tried using sho...
I am a student of programming, still in the first year of my course. So far I have studied Java , C , Haskell and Script Shell . I am fairly functional in Java and C .
I know how to write code, compile an...
import java.util.Scanner;
public class CalculoSalarioLiquido {
public static void main (String args []) {
System.out.println("Programa para calcular o Salário Líquido: ");
System.out.println("Escreva o Número de Horas Trab...
I need to list the 10 best selling products in a table using Hibernate.
The item_venda table has the following columns:
quantity
product_id
community_value
value_sub_Total
I have the following code:
public class String verifyWord(String wordChosen, Scanner reader){ //linha 1
boolean answeredCorrectly = false;
int tries = 1;
String wordChosen = random.nextInt();
String answer = wordChosen;
wh...
I'm trying to make an Exception but I can not. I would like your help to solve this problem. I'm from yesterday trying to validate a field but this is difficult ... Thanks in advance! In case this field would be named if it were null!
public...