The Artima Developer Community
Sponsored Link

Java Answers Forum
Pls Help Me.I m stuck in a java prob

2 replies on 1 page. Most recent reply: May 2, 2006 9:01 PM by José Ghislain Quenum

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Tanvir Hossain

Posts: 53
Nickname: tanvirtonu
Registered: Feb, 2006

Pls Help Me.I m stuck in a java prob Posted: Apr 22, 2006 11:50 AM
Reply to this message Reply
Advertisement
I want to apply a matrix in Java app.I want the programe to make a matrix in runtime declaring all the variables for columns and rows(according to the number of rows and columns that is given in runtime). How can i declare multiple
variables and subsequent assignment in runtime.Is it possible? Please cud anybody do a simple matrix(2 columns,2 rows)
programe in java 4 me.The programe gets the number for columns and rows from the user in runtime, then make the matrix declaring variable for the corresponding columns and rows(e.g-
c1r1,c1r2,c2r1,c2r2), and then assigning value to them by the user.


Dave Hinton

Posts: 42
Nickname: catbells
Registered: Oct, 2003

Re: Pls Help Me.I m stuck in a java prob Posted: Apr 23, 2006 6:42 AM
Reply to this message Reply
Do a web search for a java tutorial, then learn about arrays. You will need an array of arrays.

José Ghislain Quenum

Posts: 2
Nickname: princeq128
Registered: May, 2005

Re: Pls Help Me.I m stuck in a java prob Posted: May 2, 2006 9:01 PM
Reply to this message Reply
Why don't you use a two dim array?

Assume you want a matrix containing Double values:

Double[][] myDoubleMatrix = new Double[rowCount][colCount] ;


Then if you have the values you can insert them in the matrix or using a double generator with the Random object.

Flat View: This topic has 2 replies on 1 page
Topic: Session in JSP Previous Topic   Next Topic Topic: Encoding and data problem

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use