Fathi
call a function
1 Answer(s)      6 years and 11 months ago
Posted in : Java Interview Questions
Please i want to call the function union via main
How I can do it???
Here you find my code

With my best Regards,

//--------------------------------

package model;

import java.awt.event.WindowEvent;

import javax.swing.JFrame;

public class Relation
{
public boolean[][] matrix;
private boolean[][] matrix2;
int rows;
int columns;

public Relation(int rows, int columns)
{
this.rows = rows;
this.columns = columns;

System.out.println("Relation Called");

matrix = new boolean[rows][columns];
matrix2 = new boolean[rows][columns];

}

public Relation union(Relation mat)
{
boolean[][] m, p;
m = mat.getMatrix();
Relation result = new Relation(mat.rows, mat.columns);

p = result.getMatrix();

for (int i = 0; i < rows; i++)
{
for (int j = 0; j < columns; j++)
{
if ((matrix[i][j]) || (m[i][j]))
{
p[i][j] = true;
}
}
}
return result;
}

public Relation inverse()
{
boolean[][] m;
m = new boolean[columns][rows];
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < columns; j++)
{
m[j][i] = matrix[i][j];
}
}
Relation mat = new Relation(columns, rows);
mat.setMatrix(m);
return mat;
}

public static void main(String[] args)
{
Relation relation = new Relation(3, 4);

int[][] mat = { {1,0,0,0,0},
{0,1,0,0,0},
{0,0,1,0,0},
{0,0,0,1,0},
{0,0,1,0,1},
};

//calling the function union : paramtere to pass is mat
//how i call it
}
}

May 26, 2010 at 5:46 PM

Hi Friend,

Thanks

call function in php
call function in php  What is the call function in PHP please explain
call to a member function
call to a member function  While uploading the data on server i am getting following error... call to a member function children
UIWebView call javascript function
from UIWebView. Please let's know how to call JavaScript function from objective c... to call javascript function: [webView stringByEvaluatingJavaScriptFromString...UIWebView call javascript function  Hi, I am developing web browser
php function call
php function call  I have an function in error-status.php like this function validateHostName(\$hostName) { if((strpbrk(\$hostName,'`~!@#\$^&... to cal this function in my other page which is datetime.php how it is posible
function call in javascript - Java Beginners
function call in javascript  hi all, i've written a javascript , but i m unable to call a function getExpression.i dont know why getExpression function is not being called. heres my code : function
call a function - Java Interview Questions
call a function  Please i want to call the function union via main...}, }; //calling the function union : paramtere to pass is mat //how i call it } }   Hi Friend, Please post your problem
how to call javascript function from flex
how to call javascript function from flex  how to call javascript function from flex
error call to undefined function mysql_connect
error call to undefined function mysql_connect  what is error call to undefined function mysql_connect
how to call java script function through java class file
how to call java script function through java class file  how to call jframe in java script
Flex - Call JavaScript Function And Open a Popup Window that Displays Data
Flex - Call JavaScript Function And Open a Popup Window that Displays Data  Flex - Call JavaScript Function And Open a Popup Window that Displays Data
Fatal error: Call to undefined function session_register() in .php file
Fatal error: Call to undefined function session_register() in .php file  I upgraded the PHP and MySQL and in my application following error is coming: Fatal error: Call to undefined function session_register() in ...php file
how to call the array variable in scriptlet from javascript function
how to call the array variable in scriptlet from javascript function  This is the scriptlet code:- <% String[] abc={"saab","volvo","bmw","Benz... and display them in the dropdown list by using the below function function myFunction
How I call the function union from the main - Java Interview Questions
How I call the function union from the main  Please, from public static void main(String[] args) I would like to call the function union and I...}, }; //calling the function union : paramtere to pass is mat //how i call
function
PHP Function
and put the necessary coding into it and we can call this function from anywhere... manageable, robust. A general format of the function in PHP is as follows: function <function name> (<list of parameters>) With the help
PHP Call By Reference
function. PHP Call By Reference Example: <?php function swap(&...PHP Call By Reference: In PHP we can pass reference of a variable, so that we can modify the variable's value inside another function and get the modified
Invoke JavaScript function from servlet
Invoke JavaScript function from servlet You have learnt several servlet related examples. Here we are going to create an example that will call JavaScript function from the servlet. Embedding JavaScript in Servlets can be useful when
call a constructor
call a constructor  How do you call a constructor for a parent class
Calling Flex Function From JavaScript
; } .style4 { border-style: solid; border-width: 1px; } Calling Flex Function From JavaScript Sometimes, you may need to call flex function from JavaScript... by JavaScript to call the flex function, and the second parameter is the actual
Calling Anonymous JavaScript Function From Flex
application, you can call javascript function defined in html file where your flex file is embed. But you can also call an anomymous javascript function...() { alert('Anonumous function call.'); return 'success' }")); Alert.show("
call ireports
call ireports  how to call jrxml file in jsp or servlets pls give one example any one? please send one example any one
Iphone call
Iphone call  Do you have other method to make a call on Iphone,without openUrl
conference call
conference call  hi am a java beginner I want to develop a simple conference call system over a LAN can u please enlighten me on the basics that I have to do and kno first
conference call
conference call  hi am a java beginner I want to develop a simple conference call system over a LAN can u please enlighten me on the basics that I have to do and kno first
conference call
conference call  hi am a java beginner I want to develop a simple conference call system over a LAN can u please enlighten me on the basics that I have to do and kno first
conference call
conference call  hi am a java beginner I want to develop a simple conference call system over a LAN can u please enlighten me on the basics that I have to do and kno first
conference call
conference call  hi am a java beginner I want to develop a simple conference call system over a LAN can u please enlighten me on the basics that I have to do and kno first
conference call
conference call  hi am a java beginner I want to develop a simple conference call system over a LAN can u please enlighten me on the basics that I have to do and kno first
conference call
conference call  hi am a java beginner I want to develop a simple conference call system over a LAN can u please enlighten me on the basics that I have to do and kno first
making call
making call  Hi, Is it possible to make a call from application with out quitting application in iOS 4?   hello, this the code for call...]; [phoneStr release];   hello, this the code for call to a number
PHP Function
a function and put the necessary coding into it and we can call this function from... function can call itself too, this technique is called recursion.  Example... function helps us a lot. A function is a set of coding within a block, which has
Tutorials