Questions tagged [main-method]

117 questions
0
votes
1 answer

Joining Multiple Projects in one solution

I have started creating a game, and I added a second project, it's the standard XNA Windows game 3.1 project, and since the other project already had a Main to start the program and the 2nd is for game data, where as the first was for the drawing…
PCAddict
  • 35
  • 5
0
votes
1 answer

Netbeans Error: Could not find or load main class

When I run the below code, I get the error that Could not find or load main class. I have removed the package and created it again. But the error is still exist. I did some methods to fix it such as right clicking on package name -> properties ->…
User
  • 77
  • 1
  • 1
  • 7
0
votes
4 answers

Using XML-derived Variables in the Main Method

so I am making a game where the player's skill damage is determined by their Skill Level and their weapon Mastery. The two values are stored in an XML document, and I am using DOM to retrieve the values, and am trying to print their sum to the…
Jack
  • 380
  • 1
  • 3
  • 12
0
votes
3 answers

Name that pattern: Does a decent name for this type of executable module already exist?

I'm having trouble naming a set of software modules that follow the same pattern. I'm hoping this already is a named pattern as I can't come up with a decent name. The situation: I have a fairly sophisticated/complex object oriented application,…
0
votes
2 answers

Main method not found error in an applet

At my school I am using Notepad++ to write an applet, and I need to package it in a jar so I can sign it. I am attempting to do this with a batch file like this: CD C:\Users\name\Java\bin javac className.java jar cvfm className.jar Manifest.txt…
user2005938
  • 159
  • 2
  • 2
  • 14
0
votes
2 answers

Display a class named Time. (help troubleshooting code)

I need to design a class named Time. The class needs to contain: ■ Data fields hour, minute, and second that represent a time. ■ A no-arg constructor that creates a Time object for the current time. (The values of the data fields will represent the…
Mike L
  • 486
  • 5
  • 16
  • 33
0
votes
1 answer

Creat a main method to a quickSort class

This is my code so far. I need help to implement a main method that reads and sorts the supplied test files(unsorted1.txt and unsorted2.txt) public class quickSort extends DLList { public static > void…
0
votes
3 answers

Invoke the main method of a class in Mule

I have a Java class that writes data to a file every time you run the program. The Java class is written in the Mule project, and i would like to use a mule flow to invoke this Java class. So my question is - how can i invoke/start the main method…
The Georgia
  • 1,005
  • 7
  • 23
  • 59
0
votes
3 answers

".class expected" error when calling from main method from another class constructor

Im making a basic program that creates an object with certain attributes, and it works fine, but I need to load it as a independent program itself, so I created another class called Lanzador, which calls the constructor from the other class so that…
0
votes
1 answer

Does the Java main method start an infinite while-loop?

This question might be a really newbie one, but it's pretty confusing to me. I'm working on Java networking, and I'm curious as to the back-end of the main method. public static void main(String[] args) throws IOException I understand it that the…
Caffeinated
  • 11,982
  • 40
  • 122
  • 216
0
votes
1 answer

(Another) "non-static method cannot be referenced from a static context" issue

ERROR: non-static method cannot be referenced from a static context. In my case the method is called readFile(). Hi. I'm experiencing the same error that countless novice programmers have before, but despite reading about it for hours on end, I…
Default300
  • 21
  • 2
  • 6
0
votes
5 answers

Getting ExamQuestion@143c8b3 as print out in console

I have a have a class that has a method which takes a string. Then I have a method which returns the value of the above method. When ever I get the return value in my main class and print it the printed value is "ExamQuestion@143c8b3". How do I get…
logtech
  • 5
  • 5
0
votes
3 answers

Can a main method be placed in a parent class? And if so can a child object be instantiated inside that main method?

Let's say I have a class 'Person' and another class 'Survey' which extends person so Survey is the child class and Person class is the parent. Person was the first class I wrote and hence defined the main method there now since I have a child class,…
anonuser0428
  • 11,789
  • 22
  • 63
  • 86
-1
votes
1 answer

Why JVM cannot create object of class containing main method in order to access main method from that class, if it has the name of that class?

Well, I am not understanding that why JVM cannot create object of class having main method. If JVM can access main method by the name of that class then definitely it can create an object of that class right! But what is the reason behind accessing…
Vishal Barvaliya
  • 197
  • 1
  • 3
  • 14
-1
votes
1 answer

how to store/return string value from a java main method?

I have a bash script that calls the java program . java java.org.test -h "abc" The class computes the value of a specific string and this value is required by the bash script. and I should not be printing this value on the console. How can this be…
ursd
  • 45
  • 6