Click here to Skip to main content
15,887,027 members
Home / Discussions / Java
   

Java

 
QuestionJava beginner question Pin
mjs585-Oct-15 15:44
mjs585-Oct-15 15:44 
AnswerRe: Java beginner question Pin
Richard MacCutchan5-Oct-15 20:51
mveRichard MacCutchan5-Oct-15 20:51 
Questionwhat is java version of window desktop elements Pin
neodeaths5-Oct-15 0:37
neodeaths5-Oct-15 0:37 
AnswerRe: what is java version of window desktop elements Pin
Richard MacCutchan5-Oct-15 0:45
mveRichard MacCutchan5-Oct-15 0:45 
QuestionHow can I implement Markov's algorithm with variables and markers? Pin
Riccardo Bove4-Oct-15 10:31
Riccardo Bove4-Oct-15 10:31 
Questionjava Pin
Member 120298853-Oct-15 0:39
Member 120298853-Oct-15 0:39 
AnswerRe: java Pin
Richard MacCutchan3-Oct-15 1:22
mveRichard MacCutchan3-Oct-15 1:22 
QuestionJava problem beginner Pin
Member 120276961-Oct-15 23:33
Member 120276961-Oct-15 23:33 
I need to do a program with 2d array.
- it should ask the amount of columns and rows from the user
- print the array
- add numbers 1,2,3...
- print the array
- calculate every rows averige and print it after the row
- calculate every columns sum and print it after the column

Here is what i have (after two days Frown | :( )

C#
import java.util.Scanner;

public class matrix {

        private static Scanner scanner;

        public static void main(String[] args) {
            scanner = new Scanner(System.in);

                System.out.println ("Create matrix AxB");

                System.out.println ("Set rows (A)");
                int A = Integer.parseInt(scanner.nextLine());

                System.out.println("A = " + A);
                System.out.println("  ");

                System.out.print("Set columns (B)");
                int B = Integer.parseInt(scanner.nextLine());

                System.out.println("B = " + B);

                System.out.println("  ");

                int X = A * B;

                int[][] matrix = new int[A][B];

                for (int row=0; row<matrix.length; ++row)
                  for (int column=0; column<matrix[row].length; ++column) {
                    System.out.println("Set element "+row+", "+column);
                    matrix[row][column] = scanner.nextInt();
                  }

                System.out.println("Your matrix:");
                for (int row=0; row<matrix.length; ++row) {
                  for (int column=0; column<matrix[row].length; ++column)
                    System.out.print(matrix[row][column]+"\t");
                  System.out.println();
                }

                }
              }



So Please someone help me Smile | :)
AnswerRe: Java problem beginner Pin
Richard MacCutchan2-Oct-15 0:17
mveRichard MacCutchan2-Oct-15 0:17 
GeneralRe: Java problem beginner Pin
Member 120276962-Oct-15 1:46
Member 120276962-Oct-15 1:46 
GeneralRe: Java problem beginner Pin
Richard MacCutchan2-Oct-15 1:53
mveRichard MacCutchan2-Oct-15 1:53 
QuestionStoring private data in the cloud via hash functions? Pin
Keld Ølykke30-Sep-15 10:30
Keld Ølykke30-Sep-15 10:30 
QuestionJava Graphics class Pin
Member 1200394822-Sep-15 8:04
Member 1200394822-Sep-15 8:04 
AnswerRe: Java Graphics class Pin
Richard MacCutchan22-Sep-15 21:11
mveRichard MacCutchan22-Sep-15 21:11 
AnswerRe: Java Graphics class Pin
Anji Reddy26-Sep-15 6:20
Anji Reddy26-Sep-15 6:20 
QuestionUninstalling the Sun java application server problems Pin
Stephen Holdorf22-Sep-15 2:01
Stephen Holdorf22-Sep-15 2:01 
AnswerRe: Uninstalling the Sun java application server problems Pin
Richard MacCutchan22-Sep-15 21:09
mveRichard MacCutchan22-Sep-15 21:09 
QuestionWhile upgrading the axis2, i got the following java.lang.RuntimeException: Undefined 'Security policy namespace cannot be null.' resource property Pin
RohitSonawat17-Sep-15 1:26
RohitSonawat17-Sep-15 1:26 
SuggestionRe: While upgrading the axis2, i got the following java.lang.RuntimeException: Undefined 'Security policy namespace cannot be null.' resource property Pin
Richard MacCutchan17-Sep-15 1:54
mveRichard MacCutchan17-Sep-15 1:54 
Questiontranscript management using java Pin
Member 1197700411-Sep-15 4:45
Member 1197700411-Sep-15 4:45 
AnswerRe: transcript management using java Pin
Richard MacCutchan11-Sep-15 5:31
mveRichard MacCutchan11-Sep-15 5:31 
Questionbooks examples of precedures stored for sqlserver Pin
DAGOBERTO PAVEZ CASELLA8-Sep-15 6:37
professionalDAGOBERTO PAVEZ CASELLA8-Sep-15 6:37 
AnswerRe: books examples of precedures stored for sqlserver Pin
Afzaal Ahmad Zeeshan8-Sep-15 6:53
professionalAfzaal Ahmad Zeeshan8-Sep-15 6:53 
AnswerRe: books examples of precedures stored for sqlserver Pin
Wendelius8-Sep-15 7:08
mentorWendelius8-Sep-15 7:08 
QuestionDOM XSS and createElement() and getElementsByTagName() methods Pin
Supriya Tonape2-Sep-15 19:54
Supriya Tonape2-Sep-15 19:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.