Welcome to Dream.In.Code
Getting Java Help is Easy!

Join 132,640 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,092 people online right now. Registration is fast and FREE... Join Now!




Method doesnt show up..

 
Reply to this topicStart new topic

Method doesnt show up..

Shin
post 12 Oct, 2008 - 11:42 AM
Post #1


New D.I.C Head

*
Joined: 12 Oct, 2008
Posts: 6


My Contributions


it dissapeared or something..i dont know lol..
the method doesnt show up..(method pastin)
heres the code hope someone can get me out of this mess

CODE

public class Opdracht4_2
{
    
    public static void main(String[] args)
    {
         Oblong rechthoek1 = new Oblong(20.0,2.0);
        Oblong rechthoek2 = new Oblong(13.0,1.0);
        

             System.out.print("De eerste rechthoek is: <Oblong(lengte: ");
             drukAf(rechthoek1);
             System.out.print("De tweede rechthoek is: <Oblong(lengte: ");
             drukAf(rechthoek2);
             System.out.println();
        
         isGroter(rechthoek1,rechthoek2);
         pastin(rechthoek1,rechthoek2);
        


   }
    //post: heeft de attributen van rechthoek afgedrukt in het volgende formaat <Oblong(lengte: dd, hoogte: dd)>, dd stelt een double-waarde voor.
    public static void drukAf(Oblong rechthoek)
    {
       System.out.println("" + rechthoek.getLength() + ", hoogte: " + rechthoek.getHeight() + ")>");
    }

    //post: retourneert true dsd de oppervlakte van rechthoek1 groter is dan de oppervlakte van rechthoek2
    public static boolean isGroter(Oblong rechthoek1,Oblong rechthoek2)
    {

        if (rechthoek2.calculateArea() <  rechthoek1.calculateArea())
         System.out.println("De eerste rechthoek is het grootst.");
           else  if(rechthoek2.calculateArea() > rechthoek1.calculateArea())
         System.out.println("De tweede rechthoek is het grootst.");
        else
        System.out.println("Beide rechthoeken hebben dezelfde oppervlakte.");

      return true;
     }

        //post: retourneert true dsd rechthoek1  binnen rechthoek2 past.
        public static void pastin(Oblong rechthoek1, Oblong rechthoek2)
          {
              if (rechthoek1.getLength() <= rechthoek2.getLength())
            {
                    if (rechthoek1.getHeight() <= rechthoek2.getHeight())
                    {
                    System.out.println("De eerste rechthoek past wel in de tweede");
                    }
            }

            else if (rechthoek1.getHeight() <= rechthoek2.getLength())
            {
                    if (rechthoek1.getLength() <= rechthoek2.getHeight())
                    {
                    System.out.println("De eerste rechthoek past niet in de tweede");
                    }
            }

           }

}




User is offlineProfile CardPM

Go to the top of the page

abgorn
post 12 Oct, 2008 - 11:44 AM
Post #2


Hello Crap for Brains

Group Icon
Joined: 5 Jun, 2008
Posts: 863



Thanked 4 times

Dream Kudos: 25
My Contributions


Which method?
User is offlineProfile CardPM

Go to the top of the page

Shin
post 12 Oct, 2008 - 11:47 AM
Post #3


New D.I.C Head

*
Joined: 12 Oct, 2008
Posts: 6


My Contributions


method pastin
User is offlineProfile CardPM

Go to the top of the page

abgorn
post 12 Oct, 2008 - 12:01 PM
Post #4


Hello Crap for Brains

Group Icon
Joined: 5 Jun, 2008
Posts: 863



Thanked 4 times

Dream Kudos: 25
My Contributions


The method will only show if the conditionals are true, check and if they aren't, there's your problem.
User is offlineProfile CardPM

Go to the top of the page

Shin
post 12 Oct, 2008 - 12:22 PM
Post #5


New D.I.C Head

*
Joined: 12 Oct, 2008
Posts: 6


My Contributions


thx got it already
User is offlineProfile CardPM

Go to the top of the page

abgorn
post 12 Oct, 2008 - 01:09 PM
Post #6


Hello Crap for Brains

Group Icon
Joined: 5 Jun, 2008
Posts: 863



Thanked 4 times

Dream Kudos: 25
My Contributions


Then it would be great if you clicked "This Post Was Helpful!" at the bottom left of my post.

This post has been edited by abgorn: 12 Oct, 2008 - 01:10 PM
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 04:31AM

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month