Results 1 to 2 of 2
  1. #1
    n.singh is offline Member
    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Question Illegal start of expression

    import java.io.*;
    class volume_figures
    {
    void volume(int l,int b,int h)
    {
    System.out.println("Volume of cuboid="+(l*b*h));
    }
    void volume(float r1,float h1)
    {
    System.out.println("Volume of cylinder="+(3.14*r1*r1*h1));
    }
    double volume (double r2,double h2);
    {
    float v=(1/3*3.14*r2*h2);
    {
    return v;
    }
    public static void main (String[]args)throws IOException
    {
    BufferedReader br=new BufferedReader(new InputStreamReader(system.in));
    volume_figures=new volume_figures();
    System.out.println("Enter length of cuboid");
    int l=Integer.parseInt(br.readLine());
    System.out.println("Enter breadth of cuboid");
    int b=Integer.parseInt(br.readLine());
    System.out.println("Enter height of cuboid");
    int h=Integer.parseInt(br.readLine());
    ob.volume(l,b,h);
    System.out.println("Enter radius for cylinder");
    float r1=Float.parseFloat(br.readLine());
    System.out.println("Enter height of cylinder");
    float h1=Float.parseFloat(br.readLine());
    ob.volume(r1,h1);
    System.out.println("Enter radius for cone");
    double r2=Double.parseDouble(br.readLine());
    System.out.println("Enter height for cone");
    double h2=Double.parseDouble(br.readLine());
    double cone=ob.volume(r2,h2);
    System.out.println("Volume of cone"+cone);
    }
    }

    Please help illegal start of expression in - public static void main
    how to resolve it?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Illegal start of expression

    Removed from Illegal start of expression

    When you have a question, start your own thread. Don't post to old dead threads and don't hijack another poster's thread.

    Also go through Guide For New Members and BB Code List - Java Programming Forum and edit your post accordingly.

    Didn't you at least read through the responses in the thread you hijacked? You have made much the same mistake -- count your opening and closing braces { }

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Illegal start of expression
    By Robster in forum New To Java
    Replies: 3
    Last Post: 11-26-2011, 08:43 AM
  2. illegal start of expression
    By minusten in forum New To Java
    Replies: 1
    Last Post: 05-03-2011, 05:46 AM
  3. Illegal start of expression
    By Nigel in forum New To Java
    Replies: 5
    Last Post: 03-11-2011, 01:42 PM
  4. Illegal start of expression
    By Tekila in forum New To Java
    Replies: 10
    Last Post: 03-04-2011, 01:23 AM
  5. Illegal Start of an Expression
    By ddatta8 in forum New To Java
    Replies: 3
    Last Post: 12-20-2008, 09:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •