Question: How do i combine this two seperate java class into one functional class? import java.io.*;\npublic class mainClass{\n\n\npublic static void main(String args[]) throws IOException{\nInputStreamReader stdin = new InputStreamReader(System.in);\nBufferedReader console =new BufferedReader(stdin);\nint int_value;\nString s1;\nint flag=0;\nint_value=10;\nwhile (flag==0){\nSystem.out.println("Enter the actual temperature and hit Enter:");\ns1 = console.readLine();\nint_value = Integer.parseInt(s1);\nif (int_value>=-15 && int_value<=200){\nflag=1;\n}\nelse if (int_value<-15){\nSystem.out.println("Error Value too small&#92;n");\n\n }else if (int_value>200){\nSystem.out.println("Error Value too big&#92;n");\n\n }\n\n}\n\nActivities process=new Activities();\nprocess.printAllowedActivities(int_value);\n//process.listValues();\n\n}\n\n============================\n\n\nimport java.io.*;\n\nclass Exercise extends Activities{\n\nprivate int lowtemp; \nprivate int hightemp;\nprivate String name;\n\npublic void setLowTemp( int lowt)\n{\nlowtemp = lowt;\n}\n\npublic int getLowTemp()\n{\nreturn  lowtemp;\n}

Answer: your class which contains the main method must extend the "Activities" and than copy all the content form the secont one to the first one and this should do it... althow i don;t understand why to you want to combine them... The mainclass should have small functionalities and I think they are better as described here...(in 2 separated classes)... but again your call..:D
This question from the Yahoo Q&A forum is categorized in the topic: Sports