Posts by Tiago Porsch • 393 points
4 posts
-
0
votes2
answers7228
viewsA: How to remove spaces at the beginning and end of a string?
Well, only at the beginning or end is it like the Fábio Perez said, but every sentence can be like this: string frase = "Isso é uma string"; // Declaramos a string string sem = ""; // Declaramos o…
-
19
votes2
answers14617
viewsA: What is the difference and what are operators & and && e | and || in Java for?
& is a binary operation, see more on Wikipedia - Binary logic, Example: int a = 60; // Em binário, 60 é 0011 1100 int b = 13; // Em binário, 13 é 0000 1101 int c = a & b; // Complicado, mas…
-
9
votes1
answer1038
viewsQ: Is there a data structure like an associative array in Java?
Well, I’m wanting to name an Array of Strings in Java, but I wanted it to be, for example: String[] symbols; And could be declared so: symbols["name"] = "Tiago"; I know there’s no such Array, but…
-
1
votes2
answers261
viewsQ: Audioinputstream error ais = Audiosystem.getAudioInputStream(getClass().getResourceAsStream(s));
I create a class to create the Audioplayer package Audio; import javax.sound.sampled.*; public class AudioPlayer { private Clip clip; public AudioPlayer(String s) { try { AudioInputStream ais =…