| | |
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 |
911 actionlistener addball addressbook android applet application apps array automation binary bluetooth businessintelligence button card character class client code collision component consumer crashcourse css csv database desktop eclipse ee error fractal free ftp game givemetehcodez graphics gui html image integration j2me japplet java javaarraylist javac javadoc javaee javafx javaprojects jni jpanel julia jvm linked linux loan mac method migrate mobile netbeans objects online oriented phone physics printf problem program programming project projects radio recursion replaydirector reporting researchinmotion rotatetext rsa scanner se server service set sms software sort sql swing test textfield textfields threads time tree trolltech ubuntu update utility windows





