Questions tagged [main-method]
117 questions
1
vote
0 answers
Better way to call my methods in the main method for Connect Four
I'm building a program to play Connect Four. I have all my methods done and I'm just building my main method up to actually play the game. Is there a more efficient way to use my Play class than manually inputting the code the way I am? I was fine…

Pizaz
- 21
- 3
1
vote
4 answers
Uninitialized local variable - No error : Java
Here are two uninitialized local variables. Still this does not give compile time or runtime error and executes completely. Is this thing permissible in Java and How (explanation will be welcome).
class A2{ }
public class A {
public static void…

IDontKnow006
- 15
- 1
- 5
1
vote
1 answer
Cannot find Symbol - variable. In main method when symbol is used in other method
This program is used to calculate Pi by random numbers of throws(x,y coordinates) then iterate the whole process a number of times.
I get an error on the last line of code double average = average(pi) where it says cannot find symbol variable pi,…

David Brewer
- 53
- 7
1
vote
1 answer
Does not contain static main method suitable for an entry point ( but i have it configured correctly)
Hi friends i have a console application that reads data from access database update three tables and i have this automated using an software called automate 9.0 so i need to know if the exe fails and why it fails so i am tracking that with some enum…

ExpertWannaBe
- 117
- 3
- 17
1
vote
1 answer
functions calling from main method objective c
Here I need to write a function which is called from main method with integer array as a parameter please give me example.
In below example parameter are int type.
Note : please tell this is correct way to do this or not...
#import…

Nirbhav Gupta
- 106
- 2
- 9
1
vote
5 answers
Accessing variable in Main method from other class
I have two classes:
public class node {
static LinkedList nodes = new LinkedList();
public boolean visited;
public static void Main (String args []) {
System.out.println("Number of nodes in network");
Scanner sc =…

Gaurav K.
- 67
- 2
- 3
- 10
1
vote
1 answer
Running test for database adapter using main() Method
I have a problem in a system that I am working as back-end support for. I need to write a test that calls one of the classes handeling the communications with our database so I can log out what it actually returns.
System setup
Our system is…
user2033031
1
vote
5 answers
C# Console Application - Calling Main method or Class?
I have exercise/drill/homework assignment to create a C# program to compute the value of a number raised to the power of a second number. Read the two numbers from the keyboard.
Ask the user for an integer.
Print the integer back to the screen and…

WidmarkRob
- 11
- 1
- 3
1
vote
2 answers
Programmatically find default main() method from multiple main() methods using java
Given the following class, I am trying to find program's main entry point:
public class Demo {
public static void main(String[] args) {
System.out.println("Hello World!");
}
public static void main(String a, String b){
…

user1429953
- 33
- 4
0
votes
2 answers
What is the equivalent Main method for Java in c#
in
Java, you can write:
public static void Main(String[] args) { }
and than "right click" => "run as" => "Java application" and it will run the current Main Method.
Any chance to have that in Visual Web Developer?
Thanks

SexyMF
- 10,657
- 33
- 102
- 206
0
votes
4 answers
Where would I place my main method in this application?
I am currently working on an assignment where I have to create an application that uses dynamic data to fill in trees and lists. I have tried placing the main method in this class before and the only time it looked like I could compile is if i…

csstudent3423
- 37
- 3
0
votes
3 answers
Error when executing Java code with nested class
newbie here. Tried executing Java class that has a nested class and I keep getting this
Error: Could not find or load main class .
Caused by: java.lang.ClassNotFoundException
When I compiled the source code, I got two new .class files;…

Ten Kei
- 3
- 2
0
votes
0 answers
Main method not found on IntelliJ "Run"
I have just started with Codename One. I have managed to successfully run the "Get started" app on NetBeans, but decided to work on IntelliJ IDE for future development.
Followed all instructions and installed Codename One for IntelliJ. When I "Run"…

Spyros
- 339
- 1
- 7
0
votes
1 answer
Why Main method doesn't run (c#)?
So, I have to develop a simple app that measures how much time takes for a genetic algorithm to give the best answer and prints it on the screen. I've done the algorithm but something went wrong and it doesn't run the main method.
I've put the code…

Virgiliu
- 13
- 4
0
votes
3 answers
Finding the class with the main method in an applet
I'm trying to use this tool
https://swingexplorer.dev.java.net/
to find some information out about an applet's swing structure. Unfortunately, I didn't develop the applet. I've pulled the jars for the applet from the cache, but there are several…

Nathan Spears
- 1,657
- 8
- 23
- 31