- import java.lang.*;
- import java.io.*;
- public class Assignment{
- static int test(int val){
- if(val>13)
- return 1234;
- else
- return 321;
- }
- public static void main(String args[]){
- try{
- System.out.println("please enter a integer:");
- int as=System.in.read();
- int SS=Assignment.test(as);
- System.out.println("test:"+SS);
- }
- catch(IOException ioe){
- System.out.println("you are error!!!");}
- }
- }
复制代码 |