|
please do it in c# if you can, I will convert. I did my all possible things.
|
|
|
|
|
OK, but it may take some time.
|
|
|
|
|
yes, no problem. do you use messenger ?
|
|
|
|
|
OK, I got the answer in C#, so I think the Java code needs to be:
for (int i=0;i < first.length;i++)
{
for (int j = 0; j < first[i].length;j++)
{
sum[i][j] = first[i][j] + second[i][j];
System.out.print(sum[i][j] + " ");
}
System.out.println("");
}
I'm not sure about the expression first.length , but basically i needs to iterate the rows, and j the columns. You also need to print each column value without the newline (print rather than println ?) and then put the System.out.println(""); statement after the last column. It probably needs some tidying up to get the columns lined up, but I'm sure you will be able to manage it.
No, not on messenger.
|
|
|
|
|
fantastic.. It works.. you made my day (night here actually) ..
Thanks a lot.
|
|
|
|
|
Cheers, happy to help. It also gave me some incentive to get back on Java which I haven't touched for a while.
It's early evening here (UK) so are you west or east?
|
|
|
|
|
Java is very nice.
I m on east. India. +5.30
|
|
|
|
|
You may find this hard to believe but that's the country of my birth! I was born in Mussoorie (in the hills), my dad and my brother in Naini Tal.
But my only return visit was in 2005 to Bangalore, which also was nice - at least the people.
|
|
|
|
|
Hello I would like to ask a simple way to load a picture in JFrame?
I was a planning to convert my txt based game into a JFrame with a simple image
design but I dont know yet how to load a picture in JFrame.
thank if in case someone give suggestion,
dfan23
|
|
|
|
|
|
|
I am not sure whether your question is a concept or an actual implementation either way you already have the list of registered news papers just add a method to the agency class something like broadcast newspaper that takes the news papers names as parameters. In the news papers class you will have a method that listens for the broadcast.
Good luck
|
|
|
|
|
|
What is the scope of the implementation? and include the code you did so that I could analyse and give a solution.
|
|
|
|
|
|
Classes:
Agency will create 3 Files and append to them:
1. Agency: The name of it
2. AgencyNews: relating agency and news
3. News: the news of the newspaper add optional newspaper name and datetime
Steps:
Newspaper will choose which agency to write the news. The name of the newspaper and the news will be added by the agency to the files.
Agency will broadcast it by simply looping its file and getting the newspapers names then going to the AgencyNews file and locating its news file then loop over the news files and prints out the news to all the newspapers.
Things to look for:
1. Arraylist
2. append to text file
3. File directory and name
The above solution is to store more data rather than calling the methods over and over for every transaction.
This relation is better suited with database.
Hope this helps
|
|
|
|
|
Hello everybody, Is there such datagrid control in Java like we have in VS? Thank you.
modified on Wednesday, October 14, 2009 9:47 AM
|
|
|
|
|
|
|
Hi All..
I have been learning System open architechture programing interfaces. My program used Javascript(the users could used it but they could not modified it).Could someone give me a tutorial.
Thanks
Kim.
|
|
|
|
|
Clarify your question to get an answer.
|
|
|
|
|
Could you show me how to capture video screen, or desktop screen using javascript
|
|
|
|
|
Hi.
I m running this code.
import java.util.*;
public class Main{
public static void main(String[] args) {
int[] value = {2,1,3,6,5};
System.out.println(value);
Arrays.sort(value);
System.out.println(value);
}}
The output is showing..
run:
[I@3e25a5
[I@3e25a5
why is it so.. I m confused.. Please help me. Also please tell me how to do in descending order by user input. Collections class will do with List
|
|
|
|
|
nt_virus wrote: why is it so
You cannot print an array or integers directly in this way. You need to iterate the array and print each individual value after you have converted it to a character string. Take a look at some of the tutorials on the web.
|
|
|
|
|
thanks I did ascending..
public class Main{
public static void main(String[] args) {
int[] value = {2,1,3,6,5};
System.out.println("Unsorted value");
for (int s : value)
System.out.print(s + " ");
System.out.println("\n");
Arrays.sort(value);
System.out.println("sorted value ascending");
for (int s : value)
System.out.print(s + " ");
System.out.println("\n");
}}
please tell how to do descending...
|
|
|
|