Posts by Fagner Fonseca • 1,447 points
61 posts
-
6
votes1
answer438
viewsA: What is the Java Constant pool?
When the . java file is compiled, a .class. file is generated. class has the Java Byte Codes which are the java code transformed into generic machine statements. These byte codes use data such as…
-
2
votes1
answer79
viewsA: Java, difference between Integer.TYPE and int.class
Integer.TYPE and int.class are the same thing. If you run the following snippet, you will see that the return is true. System.out.println(Integer.TYPE.equals(int.class)); The definition of…
-
1
votes1
answer593
viewsA: Java cast and convert
You cannot do this conversion for 3 reasons. 1 - You can only cast if there is a extends or Implements relation between classes. Ex: public class Animal { } public class Cachorro extends Animal { }…
-
2
votes1
answer136
viewsA: Use the same getInputStream() for 2 different bufferedReader
It makes no sense to create two BufferedReaders pointing to the same InputStream. In practice they will be working on the same thing. If you try to read a file using BufferedReader in and then try…
-
0
votes1
answer924
viewsA: Check if XML TAG exists
I did it this way and it worked: XML <cfe> <infCfe> <dest> </dest> </infCfe> </cfe> Mapping: @XmlRootElement(name = "cfe") public class Cfe { private InfCfe…
-
2
votes1
answer86
viewsA: java.io.Console when debugging in Eclipse
System.console() does not work at eclipse because in fact, although you have a view called console, it is not considered a console at all. If you run the same code via terminal, it will work. That…
-
1
votes1
answer760
viewsA: Access object array within a switch
You can declare the method as follows: public void selecionarOperacao(Cliente[] array, Cliente umCliente, Funcionario umFuncionario, Visao umaVisao, Comida umaComida, Bebida umaBebida) {} You must…
-
3
votes1
answer6616
viewsA: How to resolve java.lang.Indexoutofboundsexception: Index: 25, Size: 25
According to the description of the error itself, you have a size 25 list and are trying to access position 25. The list, however, has the positions from 0 to 24. That is, you are trying to access…
-
2
votes1
answer1360
viewsA: MVC representation in UML class diagram
To represent the relationship between Main and Controller and Menu classes, you can use a dashed arrow with the instant stereotype. You can find more details about dependency usage in this link:…
-
2
votes1
answer162
viewsA: Problem trying to transfer files using Apache FTP implementation in Java
Is some Firewall problem? I couldn’t be sure. The correct thing would be to unblock the firewall or make an exception for the application. However, neither of the two options were possible. The fact…
-
1
votes1
answer162
viewsQ: Problem trying to transfer files using Apache FTP implementation in Java
I am performing file transfer via FTP using JAVA. I’m using the classes Ftpclient and Ftpserver apache. In a specific environment, sometimes files are not transferred. I call the method…