GithubHelp home page GithubHelp logo

damareszsouza / exercicio-9-em-java Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 2 KB

Vetores Classe TEST Exercicio Replicado do livro Tutorial de Programação em Java e Orientação a Objetos

intellij java vetores

exercicio-9-em-java's Introduction

Exercicio-9-em-Java

Exercicio Replicado do livro Tutorial de Programação em Java e Orientação a Objetos

class VetorTest { public static void main (String args[]) { int vetor[] = new int[3]; vetor[0] = 0; //indexacao semelhante a C , C++ vetor[1] = 10; vetor[2] = 20; System.out.println(vetor[0] + " " + vetor[1] + " " + vetor[2] + " "); } }

Resumo da sintaxe de vetores: int a[]; //declara vetor de inteiros a a = new int[10]; //aloca vetor a com dez posicoes //as duas linhas anteriores podem ser abreviadas por: int a[] = new int[10]; //alem disso se voce quiser inicializar o vetor a, ja’ na declaracao: int a[3] = {0,10,20}; O análogo para matrizes é: int a[][]; //declara matriz de inteiros a a = new int[3][3]; //aloca matriz 3x3, 9 celulas //as duas linhas anteriores podem ser abreviadas por: int a[] = new int[3][3]; //alem disso se voce quiser inicializar a matriz a ja na declaracao: int a[3][3] = {{0,10,20},{30,40,50},{60,70,80}}; Em métodos, argumentos e valores de retorno

exercicio-9-em-java's People

Contributors

damareszsouza avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.