Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Error while compiling.

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Location
    India
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Error while compiling.

    //Write a program in java to calculate the are a perimeter of a rectangle?


    class troy
    {
    public void go(int l,int b)
    {
    int xl*l)+(b*b))^0.5;
    System.out.println(x);
    }
    }

    Error msg : bad opperand types for binary operator '^'
    first type: Int sceond type: double

    --- Update ---

    Compiling in JDK latest 1.7.0_21 and Blue java 3.08

    --- Update ---

    Sorry Damn these java scripts. Auto smiley . Correction int x = ((l*l))+(b*b))^0.5


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Error while compiling.

    Please review the proper way(s) to take the square root or raise one value to the power of another in Java.

Similar Threads

  1. Compiling error
    By Nithyanathan Naiker in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 7th, 2013, 07:13 AM
  2. Compiling error
    By Bri4n in forum Java Theory & Questions
    Replies: 5
    Last Post: November 7th, 2011, 10:26 PM
  3. Compiling error
    By tangara in forum Java IDEs
    Replies: 3
    Last Post: September 4th, 2011, 03:00 AM
  4. Compiling Error?
    By Arkeshen in forum Java Theory & Questions
    Replies: 2
    Last Post: June 22nd, 2011, 04:31 AM
  5. Strange Compiling Error
    By crism85 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: October 13th, 2009, 12:59 AM

Tags for this Thread