473,503 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

There is no error but it came out could not find or load main class Employees

1 New Member
import java.util.Scanner;

import javax.swing.JOptionPane;

public class Employee{



public static void main (String[]args) {
@SuppressWarnings("resource")
Scanner input = new Scanner(System.in);
System.out.println("Employees Full Name:");
String FullName = input.nextLine();
System.out.println("Employees Full Name:"+ FullName);
System.out.println("Hours of worked in a week:");
int HW = input.nextInt();
System.out.println("Hourly Pay Rate:");
double hPayr = input.nextDouble();
int GTaxR = input.nextInt();
int ETaxR = input.nextInt();

JOptionPane.showMessageDialog(null, FullName);
System.out.println("Employees Full Name:"+ FullName);

double GrossPay = hPayr * HW;
System.out.println("Gross Pay:"+ "$" + GrossPay);
System.out.println("Deductions:");
double GTax = GTaxR * GrossPay;
System.out.println("Government Tax: "+ GTax);
double ETax = ETaxR * GrossPay;
System.out.println("Employment Tax: "+ ETax);
double TDeduction = GTax + ETax;
System.out.println("Total Deductions: "+ "$"+ TDeduction);
double NetPay = GrossPay * TDeduction;
System.out.println("Net Pay: "+ "$"+ NetPay);

}
}
Mar 15 '19 #1
1 1439
chaarmann
785 Recognized Expert Contributor
Please use code tags to show your code formatted here, else it's wasted time for a free helper.

You have called your class "Employee", without s at the end. So if you try to start "Employees", with s at the end, it will not work.

Can you please write down here how you start it? From command line instead of IDE? Then maybe you also forgot to compile it first.
You should compile and start it from command line by:
Expand|Select|Wrap|Line Numbers
  1. javac Employee.java
  2. java Employee
Apr 5 '19 #2

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

Similar topics

2
7594
by: Alan.J.Thackray | last post by:
I am new to Java. Since the "main" class has the main() function it it, is this called before the constructor, or is a constructor totally irrelevant for a main class, since you never "new" it ?...
0
1012
by: Robin | last post by:
Hi all, I am trying to dynamically load a class, and I'm having trouble getting past the Assembly.LoadFrom part (or at least I think so) Error: The located assembly's manifest definition with...
0
1483
by: Nunez | last post by:
Hello, I need some DETAILED help. I'm trying to download a java game off the internet but an error window pops up which says "Java Virtual Machine, Fail to load Main-Class manifest attribute from...
4
33127
by: Learner | last post by:
Hello, I just wanted to jump on try creating a small calss in VB.NET in a note pad. And my class takes below lines of code Public Class Product Public Name as string
1
5947
by: okonita | last post by:
Hello all, I have a Java problem that I hope can be answered here. Very new to DB2 UDB and UDF (we are on DB2v9.5, Linux and Windows), I have managed to get the UDF registered but having problem...
1
2960
by: xuki | last post by:
Hi every one! I need your help to solve this problems. I'm trying to creat a wsdl file to a webservice but i'm getting an erros. "Error creating WSDL document:Error creating WSDL: no class...
1
2749
by: trdmrk | last post by:
Hello, Ive found this site very helpful in the past, so i thought i may ask for help. I am developing an application for a school project. I am in the middle of it, I get the error:...
3
3499
by: miss peaches | last post by:
I am currently enrolled in a Java Programming Class in which we were asked to create a Class to store and retrieve an employee's name, hourly rate, and hours worked. Use constructors to initialize...
1
2412
by: divya shree | last post by:
if run the program ,i am getting no main class found eg: class top { public static void main(Sting args) { System.out.println("HEllo"); } }
1
2406
by: G lavanya | last post by:
write a sql query to find the number of employees made the transactions in a store by month where there can be multiple transactions by each employee
0
7198
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7271
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7449
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...
0
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4998
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
373
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.