Questions tagged as 'java'

4
answers

When do I really need to use the this operator in Java?

I sometimes think there is no need to use this , but since I just started learning Java, I want someone to answer when it really will be necessary to use the this operator?     
asked by 21.09.2016 / 21:21
0
answers

How do you create ZERO PDF files (without frameworks)?

Well, I'm looking at some possibilities of generating PDF's on Android (offline), and none is entirely satisfactory, whether it's the license, features, large framework, or support version of Android (there's the PdfDocument , which is availabl...
asked by 13.02.2015 / 12:03
2
answers

Map.Keyset () method does not return all keys

Friends, I have a problem and I can not identify the cause. I have a properties file here . I'm reading it normally but when I'm going to get all its keys by Map.keySet() method not all keys are being returned. input = new FileInput...
asked by 11.03.2015 / 19:27
2
answers

What is the case-convention for naming in Java? [duplicate]

I once read somewhere about good case practice when naming methods, attributes, variables ... in Java, could someone refresh my memory?     
asked by 24.10.2016 / 18:20
2
answers

What is the meaning of this line in Java?

I did not understand the following line of code below: ret += this.elem[i]+(i!=this.ultimo?", ":""); What is the meaning of these operators i! , ? and : { String ret = "{"; for (int i=0; i<=this.ultimo; i++...
asked by 20.09.2016 / 03:33
5
answers

Simple solution for Fibonacci algorithm

I have this statement in hand:    Given the Fibonacci sequence 1 1 2 3 5 8 13 ... n, write an algorithm to generate the sequence up to the nth term, which should be provided by the user. For example, if the user entered the number 40, 40 numb...
asked by 09.06.2017 / 05:46
2
answers

How to insert multiple values into an array?

A student can take several courses such as "English", "Portuguese", etc. How do I put multiple course names in an array ? I do not want to make the example with ArrayList . It's just to take one of my questions for granted. So I have to c...
asked by 16.01.2016 / 20:05
5
answers

Java - simple program (find primes) - does not run

I'm starting to learn java, I'm using the Java book in Beguinners Guide and it appeared that little problem to find the cousins from 1 - 100 and print on the screen. I made the following code. class AllPrime { public static void main(Str...
asked by 08.11.2015 / 21:44
1
answer

Doubt with PreparedStatement with INNER JOIN in Java

I'm having a question about using PreparedStatement with INNER JOIN, here's my code: public List<Emprestimo> pesquisar() throws SQLException { List<Emprestimo> listaEmprestimo = new ArrayList<Emprestimo>(); String s...
asked by 10.06.2016 / 06:58
2
answers

Separate strings from an ArrayList with comma

I do not have much knowledge of Java, I would like to separate the strings from my List, with ",". List<String> nomes = Arrays.asList("Paulo", "Ana", "Zeno", "Beno"); for(int i=0; i<nomes.size(); i++) { System.out.format("%s%s",...
asked by 06.05.2017 / 20:16