| | |
Else If statement
Thread Solved |
•
•
Join Date: Apr 2007
Posts: 40
Reputation:
Solved Threads: 0
•
•
•
•
cool, i suggest you do advance reading. so you can learn the basic structures and rules in java programming, we can't really rely much on our instructors cuz they dont care much about the important facts in programming, they just dump the code right into us (not to mention, most teacher only knows theory :p)...and explain less. im a senior college student too in the philippines, so i know that...goodluck in your studies ^^
•
•
Join Date: Sep 2007
Posts: 3
Reputation:
Solved Threads: 0
try to run this coding it will run
-------------------------------------
import java.io.*;
class input
{
public static void main( String args[])
{
String name ;
int age;
int salary;
int a2;
String s1,a1;
BufferedReader br = new BufferedReader ( new InputStreamReader (System.in));
System.out.println( " enter your name " );
s1 = br.readLine();
System.out.println (" enter your age ");
a1 = br.readLine();
a2 = Integer.parseInt(a1);
if ( a2 < 18)
{
System.out.println ( " you are not eligble for vote");
} //System.out.println (s1);
catch(IOException ioe) {}
}
}
-------------------------------------
import java.io.*;
class input
{
public static void main( String args[])
{
String name ;
int age;
int salary;
int a2;
String s1,a1;
BufferedReader br = new BufferedReader ( new InputStreamReader (System.in));
System.out.println( " enter your name " );
s1 = br.readLine();
System.out.println (" enter your age ");
a1 = br.readLine();
a2 = Integer.parseInt(a1);
if ( a2 < 18)
{
System.out.println ( " you are not eligble for vote");
} //System.out.println (s1);
catch(IOException ioe) {}
}
}
![]() |
Similar Threads
- missing return statement (Java)
- MySQL LIKE statement (MySQL)
- loop in main function to an "if" statement (C++)
- Switch Case Statement (Java)
- run sql statement in asp (ASP)
- switch/case statement (C++)
- change statement (JSP)
- Reading MSWord Document through an ASP Statement (ASP)
Other Threads in the Java Forum
- Previous Thread: Java - to Post on web
- Next Thread: If else statements on compatibility, I'm so confused here?????
| Thread Tools | Search this Thread |
account android api applet application array arrays automation bidirectional binary birt bluetooth class classes client code columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error errors exception expand fractal game givemetehcodez graphics gui guidancer homework html ide image inetaddress inheritance integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jlabel jme jni jpanel jtextfield jtree julia linux list loop map method methods midlethttpconnection mobile mobiledevelopmentcreatejar monitoring myaggfun netbeans newbie nullpointerexception open-source oracle plazmic print problem program project property recursion ria scanner search server set sharepoint smart sms smsspam sort sourcelabs splash sql sqlite static string subclass support swing testautomation threads tree unlimited webservices windows





