Solve using java language.
G: Assume you have a graph G of n-5 nodes (n vertices) represented by n’n adjacency matrix (0/1 matrix) const int n 5; int AniIn: Write the method int CountEdges(ADD) that returns the number of edges in the graph G. (1 Point) Qz: Write the method IsConnected(i,j) that returns true if the vertex i is connected with the vertex j. It returns false otherwise. (1 Point) Qs: Write the
OR
OR