6 which method is used for tokenization a

This preview shows page 2 - 4 out of 7 pages.

_________6. Which method is used for tokenization?a) useDelimiter()b) split()c) Both a and bd) None of these
Section 2:Short Answers [Total 40 points]7. Use this code to evaluate each of the following expressions. Write the result in the given blank.[18 points]import java.util.ArrayList;public class MyArrayList {public static void main(String[] args){ArrayList<String> myList = new ArrayList<String>();myList.add("mercedes");myList.add("ford");myList.add("toyota");myList.add("honda");myList.add("nissan");System.out.println(myList.get(1));//What is the output?//________ford________myList.add("hyundai");myList.add(1,"kia");System.out.println(myList.get(3));//What is the output?//________toyota__________System.out.println(myList.size());//What is the output?
//What is the output?
CSE 205Spring 2017//What is the output?
Page 3//What is the output?//________6____________for(int i = 0; i < myList.size(); i++)System.out.print(myList.get(i)+ " ");//What is the output?//_mercedes kia bmw honda nissan hyundai__}}8. Draw a UML Class diagram of the following system. [16 points]The system consists of two classes:Company:AttributescompanyName, companyTypeMethodsgetCompanyName (), getCompanyType(), setCompanyName(),setCompanyType()Order:AttributesorderNumber, numOfItemsMethodsgetOrderNumber(), setOrderNumber(), addItems()Company and Order have a one to many relationship (one company, can take many orders). Theattributes companyName, companyType and orderNumber are initialized to “?”, and numOfItems

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 7 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
Matasu
Tags
Inheritance, class a, public class

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture