The Artima Developer Community
Sponsored Link

Java Answers Forum
inpout output

1 reply on 1 page. Most recent reply: Mar 14, 2007 2:54 AM by Vincent O'Sullivan

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
maya zakry

Posts: 3
Nickname: rubymaya
Registered: Mar, 2007

inpout output Posted: Mar 13, 2007 11:28 PM
Reply to this message Reply
Advertisement
hi,
im trying to let user input a number, and send this number to my isPrime(num0 function.. my problem is i got this error : -
unexpected type
required: variable
found : value

i guess it's my void main input output.. :-
try
{
while (num1 != -1) {

System.out.print("Masukkan nombor(-1 untuk keluar) : ");
inputa = stdin.readLine();
num1 = Integer.parseInt(inputa);

if ( isPrime(num1) )
System.out.println (num1 + " ialah nombor perdana");
if ( isPrime(num1) = false )
System.out.println (num1 + " BUKAN nombor perdana");

}
}
catch(IOException ioex)
{
System.out.println("Input error");
System.exit(1);
}


Vincent O'Sullivan

Posts: 724
Nickname: vincent
Registered: Nov, 2002

Re: inpout output Posted: Mar 14, 2007 2:54 AM
Reply to this message Reply
The code snippet that you have supplied is insufficient to properly diagnose the problem. Cound you post the whole class (and enclose it in "java" blocks as per the instructions on "Formatting Your Post").

Flat View: This topic has 1 reply on 1 page
Topic: inpout output Previous Topic   Next Topic Topic: Why Doesn't My Code Work??

Sponsored Links



Google
  Web Artima.com   

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