Home Tutorialhelp Comment Help: cannot find main class.

 
 

Comment

Rajeshwari
Help: cannot find main class.,
June 1, 2008 at 11:48 AM

Getting : cannot find main class.program will exit after running below pgm.

import java.util.*;
public class VectorDemo{
public static void main(String[] args){
Vector<Object> vector = new Vector<Object>();
int primitiveType = 10;
Integer wrapperType = new Integer(20);
String str = "tapan joshi";
vector.add(primitiveType);
vector.add(wrapperType);
vector.add(str);
vector.add(2, new Integer(30));
System.out.println("the elements of vector: " + vector);
System.out.println("The size of vector are: " + vector.size());
System.out.println("The elements at position 2 is: " + vector.elementAt(2));
System.out.println("The first element of vector is: " + vector.firstElement());
System.out.println("The last element of vector is: " + vector.lastElement());
vector.removeElementAt(2);
Enumeration e=vector.elements();
System.out.println("The elements of vector: " + vector);
while(e.hasMoreElements()){
System.out.println("The elements are: " + e.nextElement());
}
}
}
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

How to eliminate error," Could not find the main class: filecopy.FileCopy. Program will exit." ?
How to eliminate error," Could not find the main class: filecopy.FileCopy....) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: filecopy.FileCopy. Program will exit. Exception in thread "main" Java 

Java Beginners

main function defnition in class - Java Beginners
main function defnition in class  why do we use public infront of a main function   Hi friend, The main method is similar to the main... and will subsequently invoke all the other methods required by your program. The main method 

Java Beginners

main() syntax - Java Beginners
] [import statements] [class declaration] [main() method] For Example: package roseindia; import java.lang; class Hello{ public static void main(String...main() syntax  Hi, I would like to know the complete structure 

Java Beginners

Main function.. - Java Beginners
Main function..  Hi Friend.. public static void main(String args[]) What does it mean...public - static - void - main -(String args[]) Can u plz...   Hi friend, public: The method can be accessed outside the class 

Java Beginners

problem with main - Java Beginners
*; public class YellowFace extends JApplet { public static final int FACE... a problem. when i compile it appears this message: java.lang.NoSuchMethodError: main Exception in thread "main" . Should i put a main in another file? And how can 

Java Beginners

could not find the main class programm will exit - error
could not find the main class programm will exit - error  when i tried to run the below mentioned programmed it gives a error states - could not find main class programm will exit. class Car { String name: String Color 

Java Beginners

cannot find symbol - Java Beginners
cannot find symbol  public class Areatest { public static void main(String[]args) { Figure[]figures={new Triangle(2.0,3.0,3.0),new Rectangle(4.0,6.0),new Square(5.0)}; for(int i=0;i 

Java Beginners

.jar file keeps giving me " could not find the main class". Program will exit.
.jar file keeps giving me " could not find the main class". Program will exit... click on it, it gives me the message" could not find the main class. Program... netbeans's project properties clearly sets testing2.hihi as my Main class and I have 

Java Beginners

What is the return type of the main method?
type of the main method? thanks   Hi, In the java programming the Main() method doesn't return anything hence declared void. In Java, you need to have a method named main in at least one class. The following is what must 

Java Beginners

main func - Java Beginners
main func  why do we pass array of strings in main function of java?  Hi Friend, It is used to signify that the user may opt to enter parameters to the java program at command line. Thanks 

Java Beginners

how to solve the nullPointer Exception in main - Java Beginners
how to solve the nullPointer Exception in main  New to Java ,pls help me how fix Null pointer Exception in main: two files , split .java another...*; public class split { public String[] spaceWord = null; public static void 

Java Beginners

Why is the main method declared static?
Java class always has the same signature, and we declare public static void main... without creating any instance for the java class, where we declared it. Any static java method can be called without having to instantiate in the class that defines 

Java Beginners

MAin error
MAin error  Error while running hello program in another dir rather in bin. path is already set. java -version jdk1.6.0_24 no error while compilation but @ d tym of runnin error in main class is generated Exception in thread 

Java Beginners

Class and interface in same file and accessing the class from a main class in different package
Class and interface in same file and accessing the class from a main class... a class named CantFly in same file. A main method CheckAnimal.java. Below... class CheckAnimals { public static void main(String[] args) { Animal 

Java Beginners

Class and interface in same file and accessing the class from a main class in different package
Class and interface in same file and accessing the class from a main class... a class named CantFly in same file. A main method CheckAnimal.java. Below... class CheckAnimals { public static void main(String[] args) { Animal 

Java Beginners

To find palindrome no in a file - Java Beginners
To find palindrome no in a file  hi all i am having a problem...I wanted to write one java program where i have to count the no of palindrome... java.io.File; public class palindromeExample { static int counter 

Java Beginners

Java - search/find a word in a text file - Java Beginners
Java - search/find a word in a text file  Hello, I would like to know how to find from a list of lets say 10 but could be more, .txt files, how...: import java.io.*; import java.util.*; public class SearchWord{ public static 

Java Beginners

class static - Java Beginners
information on Static in Java visit to : http://www.roseindia.net/java/beginners...class static  When do we declare a member of a class static?  Hi friend, public class HowToAccessStaticMethod{ int i; static int j 

Java Beginners

How to use find method in Java - Java Beginners
How to use find method in Java  Hello, I want to write a class that gets a web page, parses it, and tries to find an object with certain... class, then somehow parse through the class's objects/sub-objects, and use find 

Java Beginners

exception in thread main java.lang.unsupportedclassversionerror unsupported major.minor version 50.0 - Java Beginners
!"); } } for example: javac xxx.java-->comping java xxxx:error :exception in thread main...exception in thread main java.lang.unsupportedclassversionerror unsupported major.minor version 50.0  Below class is compling but runtime i am 

Java Beginners

exception in thread main java.lang.unsupportedclassversionerror unsupported major.minor version 50.0 - Java Beginners
. Thanks  my code is class xxx { public static void main(String...exception in thread main java.lang.unsupportedclassversionerror unsupported major.minor version 50.0  I am getting the below error when the class now 

Java Beginners

What is the arguement of main method?
/beginners/string-array.shtml. Hope it will helpful for java programmers...What is the arguement of main method?  hi, What is the arguement of main method? thanks,   Hi, For main() method accepts only an array 

Java Beginners

how to return to main menu after adding all the info. - Java Beginners
how to return to main menu after adding all the info.  import java.util.Scanner; public class RegistrationSystem { public static void main...; System.out.println("School Registration System Main Menu 

Java Beginners

java main program
java main program  how to write a main program for the following code public class JaroWinkler { private String compOne; private String compTwo; private String theMatchA = ""; private String theMatchB 

Java-Tutorials

What is Public static void main
not be any certain way for JVM to find main method in Java. Void : main is declared... in java using main method. class Helloworld { public static void main(String...[]) //this is most classic signature of main method. Remember the varargs version of java 

Java Beginners

Inner Class - Java Beginners
Inner Class  Hi, I have the following question. class Outer{ class Inner{ } public static void main(String[] args) { Outer.Inner... modifier of Inner class as "private" i.e., private class Inner{ } then after 

Java Beginners

java class string - Java Beginners
java class string  Write a program that reads three strings... : import java.io.*; public class ReadString { public static void main...://www.roseindia.net/java/beginners/ Thanks 

Java Beginners

Robot class - Java Beginners
the package java.awt.event.* in your java code.The class InputEvent is in this package...! import java.lang.*; import java.awt.*; public class Robot04{ public static void main(String[] args) throws AWTException 

Java Beginners

Can a main method be overloaded?
Can a main method be overloaded?   Hi, Can a main method be overloaded? thanks,   Hi, Yes, In Java program we could having multiple number of main() methods with different Signature and implementation in the class 

Java Beginners

MovieRating class - Java Beginners
the movie rating. 12.Create a MovieRating class that contains a private map... the class is instantiated. Also include a method which takes two parameters, rating... class to determine whether the child can watch the movie. 14.Add 

Java Beginners

Search Class - Java Beginners
Search Class  Hi i have created a search class with 3 txtfield... the output to another form rather than the search class i created. I hava...*; /** * * @author alvtan */ public class SearchForm extends ShowGUI 

Java Beginners

class Math - Java Beginners
class Math  "Helo man&sir can you share or gave me a java code hope its ok?" Complete a program that asks the user a floating-point number (either... to you. public class MathFunction { public static void main(String s 

Java Beginners

thread class - Java Beginners
the following code: class Incrementor extends Thread{ int cnt1 = 0; boolean...; } } class Decrementor extends Thread{ int cnt2 = 100; int cnt1... = cnt1; synchronized(this) { notify(); } } } public class Count{ public 

Java Beginners

When is java main method called?
When is java main method called?  When is java main method called? Please explain the main method in Java with the help of code.   In a java class, main(..) method is the first method called by java environment when 

Java Beginners

Class SALE - Java Beginners
Class SALE  A company sale 10 items at different rates and details.... import java.io.*; import java.util.*; public class SALE { public static void main(String[] args) throws Exception { ArrayList l1=new ArrayList(); ArrayList 

Java Beginners

find largest value
Java Find Largest Number import java.util.*; class FindLargest...find largest value  (Assignment 1 - LargestValue)The process... in computer applications. Write a Java application (LargestValue.java 

JDBC Questions

Exception in thread "main" java.lang.ClassCastException
){e.printStackTrace();} } } public static void main(String[] argv) { try { Class driver...Exception in thread "main" java.lang.ClassCastException  I am trying.... Anyone help me please. Java Code: import java.sql.*; import org.postgis. 

Java Beginners

Exception in thread "main" java.lang.ClassCastException
){e.printStackTrace();} } } public static void main(String[] argv) { try { Class driver...Exception in thread "main" java.lang.ClassCastException  I am trying.... Anyone help me please. Java Code: import java.sql.; import org.postgis. 

Core Java

Java error cannot find symbol
the java error cannot find symbol. In this example a class name 'cannot find...Whenever a Compiler does not recognize a class name, Java displays an error “cannot find symbol”. The reason behind cannot find symbol error 

Java Beginners

Java-Abstract Class - Java Beginners
Java-Abstract Class  Can a abstract class have a constructor ?When would the constructor in the abstract class be called ? Please give me with good...; Hi Friend, Yes. But Abstract class constructors will be called when its 

Java Interview Questions

Please find me a solution that
Please find me a solution that   Write a java program... must have the following: Two classes named "Area" and "AreaTest". Class "Area.... f. Do not use Instance Variable for your program. Class "AreaTest" has 

Java Beginners

find the factorial
find the factorial  how to find the factorial through the while loop?   class FindFactorial { public static void main(String[] args) { int value = 5, factorial = 1, temp = value; while 

General

Java error cannot find symbol
a class name 'cannot find symbol'. Inside the main method we have initialized... Java error cannot find symbol       The java error cannot find symbol occurred when a Compiler 

Java Code Examples

Java Find Median
Java Find Median In this tutorial, you will learn how to find the median of numbers. There is no built in method to find the median of a list of numbers in the Java framework. But you can create your own method when you need to find 

Development process Questions

find and substring
find and substring   **import java.io.BufferedReader; import...; import java.util.regex.Pattern; public class Findandreplace { BufferedReader... BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter find 

Java Technology Tutorials

Class
there are two classes has been used except the main class in which the main function... is using two classes. First class is another and second is the main class which... Class, Object and Methods      

Java Beginners

abstract class and overriding - Java Beginners
abstract class and overriding  what is the difference between abstract class and overriding? Interface? Give some example program?   Hi friend, Abstract class : In java programming language, abstract classes 

Java Beginners

how to find the given date is sunday
how to find the given date is sunday  how to find the given date is sunday in java?   Hi Friend, Try the following code: import java.util.*; import java.text.*; class CheckDay{ public static void main(String 

Java Code Examples

Java Find Automorphic numbers
Java Find Automorphic numbers In this section, you will learn how to find... of number 6 at the end. Here we are going to find the automorphic numbers between 1 and 1000. Here is the code: class FindAutomorphicNumber { public static void 

Java Beginners

Movie and Cinema class - Java Beginners
. In the main method of the Cinema class call a new static method that creates.... 5. Static main )Finally add another static method to the cinema class...Movie and Cinema class  Hi, I'm new in java. Can someone help me 

Java Beginners

create named class - Java Beginners
a class named Employee with name and salary. Make a class Manager inherit from...() that prints the manager?s name, department and salary. Make another class named... and methods with public accessibility) My coding : class Employee 

Java Beginners

vector prblem - Java Beginners
, Try the following code: import java.util.*; public class VectorDemo...vector prblem  a java program that will accept a shopping list of 5... static void main(String args[]){ System.out.println("Input list of 5 items 

Java Beginners

creating class and methods - Java Beginners
creating class and methods  Create a class Computer that stores... of the Computers. This class contains following methods, - Constructor method that assigns user input values to above mentioned variables. - main 

General

Main Thread and Child Thread
There are two types of threads in Java Progarm In Java there are Main and Child Threads used in Programming. Main thread is automatically created when program runs. Child Thread gets created by the main thread . Java Main 

Java Beginners

using class and methods - Java Beginners
using class and methods  Sir,Plz help me to write this below pgm... the following code: import java.util.*; public class Student{ int rollNo... getTotalMarks(){ return totalMarks; } public static void main(String[]args 

Java Interview Questions

find the volume of the box - Java Interview Questions
find the volume of the box  Write a class Box with the variable width... and a method to find the volume of the box and also write the main program, which creates the box object, and find the volume of the box. Print the result 

General

Java error cannot find symbol
Java error cannot find symbol In this section you will learn about "cannot find symbol" in java. Java cannot find symbol is a type of error occurs... illustrates what is cannot find symbol : public class CannotFindSymbol 

Java Interview Questions

how to find largest number? - Java Interview Questions
how to find largest number?  this is my java coding: import java.util.Scanner; import java.io.*; public class readNumbers { public static......   class Numbers{ public static void main(String args[]){ int i 

Java Beginners

Some error find whats the problem
Some error find whats the problem  import java.io.*; public class Replace { public void main()throwsIoException { InputStreamReader = new... not use Split method   Java replace string import java.io.*; public class 

Java Code Examples

Find Month name using DateFormatSymbols class.
Find Month name using DateFormatSymbols class. In this tutorial, you will learn how to find the month name using DateFormatSymbols class. The class... DateFormat and SimpleDateFormar use DateFormatSymbols class to encapsulate 

Java Beginners

main method
main method  Why is the java main method static 

Java Beginners

main method
can not make multiple main with in the same class program fails to compile. Compiler gives error that the main method is already defined in the class...main method  hello, Can I make multiple main methods in the same 

Java Beginners

java find the error1
java find the error1  package com.test.dao; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class DBConnections { public static String userName=""; public static String 

Java Code Examples

Java find the roots of quadratic equation
Java find the roots of quadratic equation In this tutorial, you will learn how to find the roots of quadratic equation. Quadratic Equations are always.... And this program is implemented to find the roots of the quadratic equation. The given 

Java Beginners

java class - Java Beginners
java class  How to run a java class(Mail.java) automatically in tomcat server for a particular time 

Java Beginners

coolection class
coolection class  how to find maximum and minimum from a list using max & min method of collection class   Here is an example of ArrayList which finds the maximum and minimum value element from the ArrayList. Java 

Java Tips and Examples

Find Day of Month
Find Day of Month       This example explores how to find the day of a month and the day.... The Calendar class extends Object class. It is an abstract base class and converts 

Java Beginners

main method
is a class method. void- It indicates that the main() method has no return value...main method  psvm(String args[]) what does this arguement in paranthesis denote?   Hi Friend, public-It indicates that the main() method 

Java Beginners

what is the size of java class
what is the size of java class  Could anyone tell me how to find the size of the class given below. public class Sample { private int x; private int y; private char ch; public static void main(String[] args) { Sample 

General

Find Type of Work Book
Find Type of Work Book       In this program we are going to find type... class.   public static final short sid: The sid variable is used 

Java Beginners

Simple Java class program - Java Beginners
Simple Java class program  Hello, Please help me, Write a simple class that iterates through all the arguments passed in on the command line... java.util.Iterator; public class SimpleIterator{ public static void main(String args 

Java Beginners

Difference between Java IO Class - Java Beginners
Difference between Java IO Class  What is the difference in function between Two set of Stream class as mention below- 1)FileInputStream...   Hifriend, 1. The FileOutputStream class is a subclass 

Java Beginners

Simple Java class program - Java Beginners
Simple Java class program  Hi sir, Please help me Write a simple class that iterates through all the arguments passed in on the command line...; Hi import java.util.*; import java.util.Iterator; public class 

General

Find L.C.M. of two numbers in Java
Find L.C.M. of two numbers in Java Program In this section, you will learn how to find LCM(Least Common Element) of two integers.The least common multiple... variables and determine the lcm. Here is the code: public class FindLCM 

Java Tips and Examples

Find out the prime number
Find out the prime number       This lesson of Java programming language will teach you the coding to find out whether a given number is prime or not. Here we have used the 'for loop 

Java Technology Tutorials

Difference between abstract class and an interface
an abstract class is class which cannot extends multiple classes because java... now a days in core java. This section will help you to find the differences between abstract class and interface in java. Abstract class is a class 

Java Beginners

About Main
About Main  can u create the object of one interface ? But i can able to create the abstract class through anonimous inner class.similarly can i 

Java Beginners

About Main
About Main  can u create the object of one interface ? But i can able to create the abstract class through anonimous inner class.similarly can i 

Java Beginners

movie class..(dr java) - Java Beginners
movie class..(dr java)  hi there.....am about to create a movie class... java.util.ArrayList; public class movie { private String movie_Title; private... the following code: import java.io.*; import java.util.*; public class movie 

General

Find Zodiac Sign
Find Zodiac Signs using Java Programming In this section, you will learn how to find the zodiac sign and chinese sign. For this, We have differentiated all...*; public class ZodiacSign { public static void main(String[] args 

Java Beginners

java class - Java Beginners
java class  Define a class product with the following data members 1.Product number int(Auto generated) 2.Product name char [20] 3.Price float... program to execute the above class ad functions for 5 products 

General

Find Successively Repeated Character using Java
Find Successively Repeated Character using Java In this section, we are going... class, we have found that 'm' is repeated successively. Here is the code of Main...;Main_Class{ public static void main(String[] args 

Java Beginners

java Class - Java Beginners
java Class  Can anyone please explain what this code means? import java.util.TreeMap; import java.util.Iterator; //Please tell me what this class declaration means???????????? public class ST, Val> implements Iterable 

Java Beginners

abstact class - Java Beginners
abstact class  write a java program to implement an animal abstact class 

Java Beginners

java - Java Beginners
;Hi friend, Code to find the length of Array : class CharArray { public static void main(String[] args) { char array[] = {'X','B','C','D','E...); } } For more information on java visit to : http://www.roseindia.net/java/beginners 

Java Beginners

java class - Java Beginners
java class  wts need of this code? UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());   Hi Friend, If you want to give Window look to your frame,dialog box etc,then you have to use the following 

JSP Interview Questions

how to pass variable from simple java main class(not servlet) to the jsp page?
how to pass variable from simple java main class(not servlet) to the jsp page?  I have a simple Java class in which I invoke a call to a JSP page... from the simple Java class to the JSP page. How can I do that? Here is my 

Java Beginners

java class - Java Beginners
java class  hi sir, i have to compile two classes(eg:controller.java and client.java) and i have imported some packages in it using jar files(like Activation.jar and servlet.jar) when ever i am running in command promt 

Java Beginners

The nested class - Java Beginners
The nested class  Hi, What is nested class in Java? What is the benefits of nested class? Write examples of nested class. Thanks   .../java/n/java-nested-class.shtml Thanks 

Java Beginners

with out class - Java Beginners
with out class  can we write a program with out a class in core java?if yes,give example 

Programming Tutorials

Use of getTotalIn and getTotalOut method of Deflater class in java.
Use of getTotalIn and getTotalOut method of Deflater class in java... of  Deflater. The Deflater class is used to compressed data by using ZLIB library. The Deflater class is available in java.util.zip package.The getTotalIn 

Java Beginners

user defined subclass of throwable class - Java Beginners
class ThrowableClass { public static void main(String args[]) { try... of throwable class  Hi Friend, Try the following: 1) public class... void main(String [] args) { ThrowableClass t = new ThrowableClass(); try 

Java Beginners

abstract class - Java Beginners
abstract class  what exactly is abstract class and in which cases its... and if possible send simple java programs showing its use.  Hi friend, In java programming language, abstract classes are those that works only 

Java Technology Tutorials

Interface Vs Abstract Class
faster Main reason for the existence of interfaces in Java is: to support... Interface Vs Abstract Class       There are three main differences between an interface and an abstract 

Java Beginners

class - Java Beginners
Class java.lang.nullpointerexception  When the class java.lang.nullpointerexception occurs 

JSP-Tutorials

Find Type of Excel Sheet
Find Type of Excel Sheet       In this program we are going to find type of an excel sheet... is used to give the description  copied  from class. public static 

Java Beginners

Abstract class - Java Beginners
Abstract class  Why can use abstract class in java.?when abstract class use in java.plz Explain with program.   abstract class abs{ public void display(){ } public abstract void display1(); } public class win 

Java Beginners

class Calendar - Java Beginners
class Calendar  Design the class Calender so that the program can... add the appropriate number of days to Monday, January1, 1500. for the class... the problem visit to : http://www.roseindia.net/java/java-get-example 

Java Tips and Examples

A program to find the sum of odd number
A program to find the sum of odd number In this section you will learn how to find the sum of odd number in the series up to the given number in java. The java.io package  provide class scanner which read the input from 

Java Beginners

JLabel class - Java Beginners
JLabel class  what are the superclasses of the JLabel class? Thanks taylordk@nationwide.com  Hi Friend, JComponent class is the superclass of all the swing components.The JComponent Class provides the framework 

Advertisements Advertisements
 

 

 

DMCA.com