201671010113 2016-2017-2 The Nineth week of Java programming

Source: Internet
Author: User
Tags throw exception

I feel this week's learning content is relatively small compared to the previous weeks, but the task volume is still quite a lot, the operation of the front pull a bit long, originally wanted to take a break on Sunday, in Friday after school began to write Java homework, the results to Sunday has not been completed, and because the front is a bit long, The task of doing the experiment before today forgot a lot. Feeling abnormal handling is very simple, but in the process of writing industry still found in addition to throw exception will check the exception is relatively simple, the other is still problematic, the Try-catch statement seems simple, but in the file I still under a kung fu, try statement to run through the file processing always, Variables set inside the file-handling code cannot be called outside of the try statement. Task Five task 6th log Breakpoint Self-study really difficult, code is very long, there are a lot of code can not understand, the cost of a great effort, the result is still not. The last Test mission, is really very serious in doing, the results in the name of the judge whether there is a number, the final result is always out, and then the name came out, score on the problem, I am powerless, the code results are as follows:

for (int i = 0; i < 4; i++)
{
if (Isdigist (Stu[i].getname (). CharAt (1)))
{
System.out.println ("Illegalnameexception:the first char of name must not be digit, name=" + stu[i].getname ());
Stu[i].setname (Stu[i].getname ());


}
Else
{
if ((Stu[i].getscore () > 0) && (Stu[i].getscore () < 100))
{
System.out.println (Stu[i].tostring ());
}
Else
{

System.out.println ("Illegalscoreexception:score out of range, score=" + stu[i].getscore ());
Stu[i].addscore (Stu[i].getscore ());
}

}

201671010113 2016-2017-2 The Nineth week of Java programming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.