The Artima Developer Community
Sponsored Link

Java Answers Forum
large problem with int

1 reply on 1 page. Most recent reply: Mar 24, 2003 1:01 AM by Rahul

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Just

Posts: 6
Nickname: rusty
Registered: Mar, 2003

large problem with int Posted: Mar 22, 2003 12:41 AM
Reply to this message Reply
Advertisement
Basically the java program is about football,
But I can?t seem to fix the int?s, please help.




import cls.keyboard;
public class PO3Main
{

public static void main (string [ ] args)
{
String

System.out.print1n ("Fred bloggs. 0234567x. Friday 9. Room F1 - 15");
System.out.println ("************************************************");
System.out.println ("****************");
System.out.println ("****************");

int
Ramround1 =123;
Ramround2 =321;
Ramround2 =321;
Ramround2 =321;
Ramround2 =321;
Ramround3 =234;
Oppround1 =432;
Oppround2 =345;
Oppround3 =543;
For1 =702;
Against1 =1296;
Average1 =234;

System.out.println ("Enter the score for the Rams football team (Round 1)>");
Ramround1 = Keyboard.int ( );

System.out.println ("Enter the score for the opposition football team (Round 1)");
Oppround1 = Keyboard.int ( );

System.out.println ("Enter the score for the Rams football team (Round 2)");
Ramround2 = Keyboard.int ( );

System.out.println ("Enter the score for the opposition football team (Round 2)");
Oppround2 = Keyboard.int ( );

System.out.println ("Enter the score for the Rams football team (Round 3)");
Ramround3 = Keyboard.int ( );

System.out.println ("Enter the score for the opposition football team (Round 3)");
Oppround3 = Keyboard.int ( );


}
}


Rahul

Posts: 52
Nickname: wildhorse
Registered: Oct, 2002

Re: large problem with int Posted: Mar 24, 2003 1:01 AM
Reply to this message Reply
I don't understand. import shows cls.Keyboard (with a capital 'K') and in the code you are using keyboard.int() (with a small 'k').

Another thing, can u have a method name same as a primitive datatype (int)? I don't think so. Rename the int() method to something else in cls.keyboard class and then check.

And when declaring variables, use a comma if u haven't yet done with int.

e.g. int a=1,b=2;

Flat View: This topic has 1 reply on 1 page
Topic: problem with array of class objects Previous Topic   Next Topic Topic: Composite pattern

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use