| | |
Else If statement
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
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?????
Views: 5646 | Replies: 21
| Thread Tools | Search this Thread |
Tag cloud for Java
911 addball android api append apple applet application arguments array arrays automation binary bluetooth button chat class classes client code component css csv database detection draw eclipse ee error event exception file fractal game givemetehcodez graphics gui helpwithhomework html ide image input integer j2me java javaprojects jmf jni jpanel julia jvm key linux list loan loop map method methods mobile netbeans newbie number object oracle os output packets phone print problem program programming project recursion reporting robot scanner screen se server service set size sms socket software sort sql stream string swing test threads time transfer tree ubuntu windows wrong





