Fathi
call a function
1 Answer(s)      3 years 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
}
}

View Answers

May 26, 2010 at 5:46 PM


Hi Friend,

Please post your problem in detail.

Thanks









Related Pages:
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
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
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 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
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
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 an array from multiple functions
Call an array from multiple functions  I am having two methods in this method i am getting array values from another class. i create same array name...(array) that is the function i called second one is access and also
How to call print dialog box through JMenuItem?
How to call print dialog box through JMenuItem?  What is the way to call the print dialog box through JMenuItem to print the current page like we can do in javascript by calling window.print() function
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
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
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
javascript function - Development process
javascript function  I'm trying to use a remote menu with 4 different menu options. i put the menu names in an array, then tried to call up the on click function with an id number. I've tried everything and nothing works
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("
how to make paging with function ?
"); //this page in only function call and next page in function body paging($offset...how to make paging with function ?  how to make paging with function... Document <?php</p> function paging($offset,$rowsPerPage,$query
calling function - JSP-Servlet
calling function  Hai, How to call a java file in jsp file?  Hi friend, Step to be remember for solving the problem : 1.Create a jsp page "test.jsp" Example of Extends Attribute of page
function
function  difference between function overloading and operator overloading
getting null value in action from ajax call
getting null value in action from ajax call  Getting null value from ajax call in action (FirstList.java)... first list is loading correctly. Need...;/title> </head> <script> function show_details
getting null value in action from ajax call
getting null value in action from ajax call  Getting null value from ajax call in action (FirstList.java)... first list is loading correctly. Need...;/title> </head> <script> function show_details
getting null value in action from ajax call
getting null value in action from ajax call  Getting null value from ajax call in action (FirstList.java)... first list is loading correctly. Need...;/title> </head> <script> function show_details
PHP User Defined Function
PHP User Defined Function An user-defined function saves  us from ... functions as per the need. General structure of the user defined function is: function function_name([mixed $var,.....]){ PHP code} mixed is the datatype
JavaScript call from flex application
; } A JavaScript call from flex application In flex application, you may have called function defined in action script. Sometimes you may need to call...() method is used to call the javascript function. The first argument takes the name
bsearch() function in C
is allowed to input the character to search and call to bsearch() function...bsearch() function in C Programming Language This section demonstrates the use bsearch() function in C. This searches function the given key in the array
call a constructor
call a constructor  How do you call a constructor for a parent class
calling zipping function - JSP-Servlet
calling zipping function  Hi, Is it possible to zip a jsp file. I wrote a java function for zipping a file.How to call that java file (zipping function ) in JSP ? pls help me Thanks.... 
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
Create a input button inside js function
Create a input button inside js function  I call my js function from... is the right way   I call my js function from HTML code from another file... using createElement() in my called function. I used something like
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
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
From struts calling function to bean - EJB
From struts calling function to bean   I am calling a function from "struts action class" to bean. I am using weblogic 8.1 web server.i am able to call the function from action class,when i restart the server.But when i
ask how function jCalender - Date Calendar
ask how function jCalender  d, Halo friend, i want to ask how to make this script can run and call JCalender. I want to know how to make private this code.i has already insert plugin in my netbeans. try
PHP Polymorphism Function
PHP Polymorphism Function: The PHP Polymorphism Method is one of the feature... Run time Compile time polymorphism PHP is like function overloading, operator overloading etc. In Polymorphism function overloading we can create more than
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
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
calling a javascript function by passing multiple values from applet in web application
calling a javascript function by passing multiple values from applet in web application  Hi all, I have a requirement like this, I have to call a javascript function from JApplet by passing 3 values. I am new to Applets
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

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.