473,396 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

can we call main method from another main method

how can we call one class main method from another class main method?
i tried but i got an idea for method we can call one method from another method
Sep 5 '07 #1
2 18731
madhoriya22
252 100+
how can we call one class main method from another class main method?
Hi,
Plz make urself more clear. Why do you need that?
i tried but i got an idea for method we can call one method from another method
What do you mean by that line?
Sep 5 '07 #2
misaw
17
how can we call one class main method from another class main method?
i tried but i got an idea for method we can call one method from another method
Try this ...
Expand|Select|Wrap|Line Numbers
  1. ClassB {
  2. public static void main(String[] args) {
  3.         System.out.println("ClassB main() Called");
  4. }
  5. }
  6.  
  7. ClassA {
  8. public static void main(String[] args) {
  9.                 System.out.println("ClassA main() Called");
  10.         ClassB.main(args);
  11. }
  12. }
  13.  
ouput
ClassA main() Called
ClassB main() Called

static methods are called without instantiating the object of class containing the method.
Sep 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Tubby Tudor | last post by:
What is the best way to call one python script from within another python script? For example: one.py finishes succesfully and calls two.py which finishes OK and then calls three.py Thanks...
4
by: Christian | last post by:
From a not even newbie: Without knowing much about Python (yet) I'm trying to install the CMS Zope via FTP (with the well documented changes to make it work on an Apache server). By birth Zope...
4
by: Dave | last post by:
I have a program that I've written a class for. I need to call the function in the program from the class. When I try to call the function I receive the error, the name xxx does not exist in the...
20
by: Cybertof | last post by:
Hello, Is there a good way to call a big time-consumming function from an ActiveX DLL (interoped) through a thread without blocking the main UI ? Here are the details : I have a class...
5
by: Paul Hasell | last post by:
Hi, I'm trying to invoke a web method asynchronously but just can't seem to get it to tell me when it has finished! Below is the code I am (currently) using: private void...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
9
by: =?iso-8859-1?Q?Jos=E9_Joye?= | last post by:
I'm currently running some tests with WCF in In-proc environment. I have created a small winform application that starts the host in the main thread with an named pipe endpoint. If I call a...
5
by: RP | last post by:
I have a function to fill combo box items. I pass SQL query and combo box name as arguments. This function is located in another class. In my Form, I have declared a delegate to this function...
1
by: Przemyslaw Koprowski | last post by:
Hi all, Imagine you have a class, containing two methods with the same name (say 'get'), but one being an inspector the other mutator - the class contains a kind of data structure (vector in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.