[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-311580-105":3,"doc-detail-311580-en":81,"detail-sidebar-cat-0-en-105":98},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","ap-computer-science-a-free-response-questions-2026","AP® Computer Science A - Free-Response Questions - 2026","","AP® Computer Science A Section II free-response exam for 2026 includes four Java-writing questions to be completed in 1 hour and 30 minutes. Instructions specify using the provided Java Quick Reference and that only responses entered in the online application receive credit. Students may use accessible methods from the question-specific classes, must follow stated preconditions, and may switch between questions until time expires. The exam format highlights digital delivery for classroom use and access to reference information via AP Central.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/exam/","Exam",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/ap-computer-science-a-free-response-questions-2026/311580/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/ap-computer-science-a-free-response-questions-2026/311580.png","ImageObject",300,407,{"name":42,"@type":43},"Evangeline","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-10-30","2026-09-20",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",10,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"How many free-response questions are in Section II, and how long is it?","Question",{"text":63,"@type":64},"Section II has 4 free-response questions and lasts 1 hour and 30 minutes.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"What programming language must students use?",{"text":68,"@type":64},"All program segments must be written in Java.",{"name":70,"@type":61,"acceptedAnswer":71},"When are responses scored, and does annotation text count?",{"text":72,"@type":64},"Credit is given only for responses entered in the application; text entered as an annotation is not included.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},311580,1790050412,{"code":4,"msg":82,"data":83},"success",{"doc_id":79,"user_id":84,"nickname":42,"user_avatar":85,"doc_module":4,"category_id":33,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":86,"file_id":87,"file_url":88,"file_type":89,"file_size":90,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":91,"language":92,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":93,"faqs":94,"seo_title":95,"seo_description":12,"update_tm":96,"read_time":97,"preview_page_count":4},13056703019662,"https://ap-avatar.wpscdn.com/avatar/be000253a8e92610077?_k=1778726343310543188","2026  \nAP® Computer Science A Free-Response Questions  \n© 2026 College Board. College Board, Advanced Placement, AP, AP Central, and the acorn logo are registered [trademarks of College Board. Visit College Board on the web: collegeboard.org](trademarks of College Board. Visit College Board on the web: collegeboard.org).  \nAP Central is the official online home for [the AP Program: apcentral.collegeboard.org](the AP Program: apcentral.collegeboard.org).  \nCOMPUTER SCIENCE A  \nSECTION II  \nTIME – 1 HOUR AND 30 MINUTES  \nDirections:  \nSection II has 4 free-response questions and lasts 1 hour and 30 minutes.  \nAll program segments must be written in Java.  \nJava Quick Reference information for programming questions can be used throughout the exam. A digital version is available in this application.  \nAssume that the classes listed in the Java Quick Reference have been imported where appropriate. Unless otherwise noted in the question, assume that parameters in method calls are not null and that methods are called only when their preconditions are satisfied.  \nIn writing solutions for each question, you may use any of the accessible methods listed in classes defined in that question. Writing significant amounts of code that can be replaced by a call to oneof these methods will not receive full credit.  \nYou may use the available paper for scratch work, but credit will only be given for responses entered in this application. Text you enter as an annotation will not be included as part of your answer.  \nYou can go back and forth between questions in this section until time expires. The clock will turn red when 5 minutes remain—the proctor will not give you any time updates or warnings.  \nNote: This exam was originally administered digitally. It is presented here in a format optimized for teacher and student use in the classroom.  \nDuring the AP Exam administration, students have access to reference information. To see the reference information for this course, please visit AP Central:  \n[https://apcentral.collegeboard.org/exam-administration-ordering-scores/administering-exams/](https://apcentral.collegeboard.org/exam-administration-ordering-scores/administering-exams/)[ ](https://apcentral.collegeboard.org/exam-administration-ordering-scores/administering-exams/)[subject-specific/reference-information](subject-specific/reference-information)  \n1. This question involves the Account class, which is used to represent user accounts for a website. The Account class contains a helper method, isAvailable, which determines whether a username is available. You will write a constructor and a method in the Account class.  \npublic class Account  \n{  \nprivate String username; // To be initialized in part (a)  \n/**  \n* Creates a username based on the parameter requestedName . If the  \n* username is unavailable, appends successive integers, beginning  \n* with 1, to requestedName until an available username is found,* as described in part (a) .  \n*/  \npublic Account(String requestedName)  \n{ /* to be implemented in part (a) */ }  \n/**  \n* Returns true if the parameter str is an available username;  \n* returns false otherwise .  \n*/  \npublic static boolean isAvailable(String str)  \n{ /* implementation not shown */ }  \n/**  \n* Returns a shortened version of username with each hyphen (\"-\")  \n* and the character before it removed, as described in part (b)  \n* Preconditions: username does not start or end with a hyphen.  \n* username does not contain consecutive hyphens.  \n* username.length() >= 2  \n* Postcondition: username is unchanged.  \n*/  \npublic String getShortenedName()  \n{ /* to be implemented in part (b) */ }  \n/* There may be instance variables, constructors, and methods that are not shown . */  \n}  \nThe following information applies to part A.  \nIn part A, you will write the Account constructor, which creates a username based on the parameter requestedName.  \nA helper method, isAvailable, has been provided to determine whether a username is ","cbCaigQxG8v8AxpU","https://ap.wps.com/l/cbCaigQxG8v8AxpU","pdf",277439,13,"English","# Section II Instructions\n## Exam overview and timing\n## Java requirements and allowed references\n## Scoring and answer submission\n## Navigation and time warnings\n# Question 1: Account class","[{\"question\":\"How many free-response questions are in Section II, and how long is it?\",\"answer\":\"Section II has 4 free-response questions and lasts 1 hour and 30 minutes.\"},{\"question\":\"What programming language must students use?\",\"answer\":\"All program segments must be written in Java.\"},{\"question\":\"When are responses scored, and does annotation text count?\",\"answer\":\"Credit is given only for responses entered in the application; text entered as an annotation is not included.\"}]","AP® Computer Science A - Free-Response Questions - 2026 | PDF",1789894488,33,{"code":4,"msg":82,"data":99},[100,104,108,111,116,121,126,131,136,139,142],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":101,"show_sort_weight":102,"slug":103},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":105,"show_sort_weight":106,"slug":107},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":109,"slug":110},70,"exam",{"id":112,"doc_module":4,"doc_module_name":25,"category_name":113,"show_sort_weight":114,"slug":115},5,"Comic",60,"comic",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":118,"show_sort_weight":119,"slug":120},6,"Technology",50,"technology",{"id":122,"doc_module":4,"doc_module_name":25,"category_name":123,"show_sort_weight":124,"slug":125},7,"Healthcare",40,"healthcare",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":129,"slug":130},8,"Research & Report",30,"research-report",{"id":132,"doc_module":4,"doc_module_name":25,"category_name":133,"show_sort_weight":134,"slug":135},9,"Religion & Spirituality",20,"religion-spirituality",{"id":134,"doc_module":4,"doc_module_name":25,"category_name":137,"show_sort_weight":134,"slug":138},"World Cup","world-cup",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":140,"show_sort_weight":55,"slug":141},"Lifestyle","lifestyle",{"id":143,"doc_module":4,"doc_module_name":25,"category_name":144,"show_sort_weight":112,"slug":145},19,"General","general"]