“Afficher Matrice Java” Kode Jawaban

Afficher Matrice Java

int[][] matrice =
{
   { 0, 1, 4, 3 } , // tableau [0] de int	(1)
   { 5, 7, 9, 11, 13, 15, 17 } // tableau [1] de int	(2)
};

System.out.println(Arrays.toString(matrice[0])); // Affiche (1)
System.out.println(Arrays.toString(matrice[1])); // Affiche (2)
maximilien rath

Afficher Matrice Java

import java.lang.*;
import java.util.*;
  
// Driver class
class Main {
    public static void main(String[] args)
    {
        Student[] arr = { new Student(111, "bbbb", "london"),
                          new Student(131, "aaaa", "nyc"),
                          new Student(121, "cccc", "jaipur") };
  
        System.out.println(Arrays.toString(arr));
    }
}
  
// A class to represent a student.
class Student {
    int rollno;
    String name, address;
  
    // Constructor
    public Student(int rollno, String name,
                   String address)
    {
        this.rollno = rollno;
        this.name = name;
        this.address = address;
    }
  
    // Used to print student details in main()
    @override
    public String toString()
    {
        return this.rollno + " " + this.name + " " + this.address;
    }
}
maximilien rath

Jawaban yang mirip dengan “Afficher Matrice Java”

Pertanyaan yang mirip dengan “Afficher Matrice Java”

Lebih banyak jawaban terkait untuk “Afficher Matrice Java” di Java

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya