Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-10-2012, 10:22 PM   PM User | #1
dannyboi
New Coder

 
Join Date: Jul 2012
Location: NYC
Posts: 23
Thanks: 1
Thanked 0 Times in 0 Posts
dannyboi is an unknown quantity at this point
Need help with Boolean Statements?

This is the code I got from my programming book, a relatively simple demonstration of Boolean statements in Java.

public class Main {


public static void main(String[] args) {
if (salesTotal <10000)
{
if (salesClass ==1)
commissionRate = 0.02;

}
else
{

if (salesClass == 1)
commissionRate = 0.025

}


This code received, from the compiler, messages ranging from "} missing" to "Main method is missing". I don't know what to do, does anybody here know?

Last edited by dannyboi; 08-11-2012 at 01:54 AM..
dannyboi is offline   Reply With Quote
Old 08-10-2012, 10:25 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,662
Thanks: 4
Thanked 2,452 Times in 2,421 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
If that's all you have, then of course you have a lot of compilation errors.
You need to specify the class and the method (likely main if you are trying to execute it). Otherwise, post the entire relevant class. Make sure its wrapped in [code][/code] or [php][/php] tags.
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Tags
java, java programming

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:24 PM.


Advertisement
Log in to turn off these ads.