Posts by Iago Coutinho Campos • 490 points
11 posts
-
1
votes1
answer166
viewsA: Improving Login Logic - JDBC - Javaweb
Good afternoon! You could use the clause where in your sql, passing the user and password, let db do the search and deliver you the correct user, improving the security and readability of your code,…
-
3
votes1
answer284
viewsQ: How to get the time in seconds of a date in string format?
I know the function time(0) me returns the seconds since the first of January 1970, in case the user would enter a date (dd-mm-yyyy or in any format due to system limitation) and the system would…
-
2
votes2
answers949
viewsQ: What is the best way to pass a context to a nested class?
I have a nested class that’s used for a new Thread and it has some Toast to present some information to the user depending on the error. I tried to pass the context through the constructor, I…
-
0
votes1
answer93
viewsQ: Use an sql class. Connection for each task or just a globally referenced one?
I have a class that is responsible for verifying the user’s account and password when logging in, and in the future I will need to implement another class to get other data in the database and…
-
0
votes1
answer86
viewsA: Unity Roguelike help
The error says that there is no method to be overwritten with that name in higher classes or if there is such a method they are not marked as virtual or Abstract. I do not know what is the…
-
7
votes2
answers6930
viewsQ: Why doesn’t my image appear when running the app?
I have the following xml code in Android Studio: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android = "http://schemas.android.com/apk/res/android" xmlns:app =…
-
5
votes1
answer91
viewsQ: Is it possible to make a mistake that triggers others?
Follow an example: public class Teste { public static void main(String[] args) { func1(); } public static void func1() { try { func2(); } catch (Exception e) { System.err.println("Error 1\n"); } }…
-
8
votes1
answer93
viewsQ: Does Java misjudge memory usage values or is there something wrong with the algorithm?
I was studying GC and the doubt arose when I ran it below: public class Garbage { public static long carregarMemoria() { List<Integer> list = new ArrayList<>(); for (int i = 0; i <…
-
2
votes2
answers188
viewsQ: Is it possible to return a variable from an object-oriented class without using a function?
I do not know if there is this possibility. Follow a code to assist in the question: public class Square { int side; public Square(int side) { this.side = side; } int getArea() { return side * side;…
javaasked Iago Coutinho Campos 490 -
2
votes2
answers220
viewsQ: Is there a function to reindexe a multidimensional array?
Guys, in need of help, I have a function that returns the following array: Array ( [0] => Array ( [0] => valor1 [2] => valor2 ) [1] => Array ( [0] => valor3 [1] => valor4 [3] =>…
-
4
votes1
answer284
viewsQ: Is it possible to create a decision structure in a table in SQL?
I have a massive database, has more than 2,000 lines, and the second column has an ENUM that allows only 'Option 1' and 'Option 2'. If I insert 200 lines into the table and write the wrong ENUM name…