Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


Fathi
call a function
1 Answer(s)      4 years and 2 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.WindowAdapter;
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);

System.out.print("Give your name: ");

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
}
}


Advertisement
View Answers

May 26, 2010 at 5:46 PM


Hi Friend,

Please post your problem in detail.

Thanks


Related Tutorials/Questions & Answers:
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
Advertisements
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
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
function
function  difference between function overloading and operator overloading
call a constructor
call a constructor  How do you call a constructor for a parent class
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 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
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
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
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("
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
VoIP Call
VoIP Call VoIP Call quality Network testing and monitoring vendors are betting you will as they peddle new call quality management applications..., and businesses embracing VoIP can't afford to make assumptions about call quality
Function pointer in c
Function pointer in c  What is the difference between function call with function pointer and without function pointer(normal function call
Call Procedure
Call Procedure      ... an example from 'Call Procedure'. In this Tutorial we create a table 'Stu_Table...$$ DELIMITER ; Call Procedure The call stu(10) return you
How to call servlet in JSP?
How to call servlet in JSP?  How to call servlet in JSP
what is an ajax call?
what is an ajax call?  can u please explain the correct usage of an ajax call in jsps and java script
Call UIViewController over RootViewController
Call UIViewController over RootViewController   Hi, i have created the window based application.. but not sure how to call the UIView over RootViewController. Thanks
tomcat jsp call DLL
tomcat jsp call DLL  Where can i find Example of use JSP under Tomcat environment call DLL
Call a servlet on click of hyperlink
Call a servlet on click of hyperlink  Call a servlet on click... to call a servlet</h2><br/> <a href="<%=request.getContextPath()%>/ServletConstructor">Click to call servlet</a> <
how to call static method
how to call static method  class A { //some code } class B extends class A { static method() } class C { } //how to access static method() from B to C
how to call static method
how to call static method  class A { //some code } class B extends class A { static method() } class C { } //how to access static method() from B to C
how to call static method
how to call static method  class A { //some code } class B extends A { static method() } class C { } //how to access static method() from B to C
how to call static method
how to call static method  class A { //some code } class B extends A { static method() } class C { } //how to access static method() from B to C
how to call static method
how to call static method  class A { //some code } class B extends class A { static method() } class C { } //how to access static method() from B to C
how to call static method
how to call static method  class A { //some code } class B extends A { static method() } class C { } //how to access static method() from B to C
Call Https Url
Call Https Url  I have written web service and hosted project on server with SSL certificate.If I want to call HTTPS url, I need to import certificate in JVM manually or through program on client side. I can't ask any client
what is an ajax call?
what is an ajax call?  can u please explain the correct usage of an ajax call in jsps and java script.   hi friend, Ajax is new technologies for the development of web application. Ajax is known as Asynchronous
how call ireports in jsp
how call ireports in jsp  please send me code any one for calling ireports in servlet-jsp program i am trying to call the ireports in servlet and jsp error is occurred exception: javax.servlet.ServletException
https call in AJAX - Ajax
https call in AJAX  Hi, I am trying to call a https URL in my AJAX script which is in my JSP. But it is not getting the reponse from the url i gave.. am using IE6. suggestions needed.. and more urgent  Hi Friend
xcode make phone call
xcode make phone call  xcode make phone call - Our iPhone application required a feature to call over any given mobile or phone number. Just wondering how to enable this feature in my application. Though i have see
Advertisements
 

 

 

DMCA.com