Skip to content

Instantly share code, notes, and snippets.

View HelberthyGomes's full-sized avatar

Helberthy HelberthyGomes

View GitHub Profile
package codeCamp;
import java.util.HashMap;
public class contemOuVazio {
void main(){
//Como verificar se um mapa hash contém um item ou se está vazio?
HashMap<String, Double> preco = new HashMap<>();
preco.put("apple", 2.0);
@HelberthyGomes
HelberthyGomes / hashMap.java
Last active November 2, 2025 18:25
hashMap
package codeCamp;
import java.util.HashMap;
public class hashMap {
void main(){
HashMap<String, Double> prices = new HashMap<>();
prices.put("maçã", 2.0);
prices.put("Laranja", 1.8);
@HelberthyGomes
HelberthyGomes / removerElementos.java
Created November 2, 2025 05:15
removendoElementos
package codeCamp;
import java.util.ArrayList;
public class removerElementos {
void main(){
ArrayList<Integer> numeros = new ArrayList<>();
for (int i = 0; i <= 10; i++){
package MeusProjetos;
public class multiplicandoPorCinco {
public static void main(String[] args){
int numero =5;
for (int multiplicar = 1; multiplicar <=10; multiplicar++){
System.out.println(String.format("%d x %d = %d", numero, multiplicar, numero * multiplicar));
@HelberthyGomes
HelberthyGomes / comparandoMatrizes.java
Created October 31, 2025 06:35
comparadorMatrizes
package MeusProjetos;
public class comparandoMatrizes {
public static void main(String[] args){
int numerosImpares1[] = {1, 3, 5, 7 ,9, 11, 13, 15};
int numerosImpares2[] = {1, 3, 5, 7 ,9, 11, 13, 15};
System.out.println(numerosImpares1 == numerosImpares2); //false
}
@HelberthyGomes
HelberthyGomes / comparandoMatrizes.java
Created October 31, 2025 06:35
comparandoMatrizes
package MeusProjetos;
public class comparandoMatrizes {
public static void main(String[] args){
int numerosImpares1[] = {1, 3, 5, 7 ,9, 11, 13, 15};
int numerosImpares2[] = {1, 3, 5, 7 ,9, 11, 13, 15};
System.out.println(numerosImpares1 == numerosImpares2); //false
}
@HelberthyGomes
HelberthyGomes / preencherMatriz.java
Created October 30, 2025 23:01
preenchimentoDeMatriz preenchimentoDeMatriz
package MeusProjetos;
import java.util.Arrays;
public class preencherMatriz {
public static void main(String[] args){
char vogais[] = {'e', 'u', 'o', 'i', 'a',};
int startIndex = 1;
int endIndex = 4;