Q11hardLook at this Regex: ^\d{5}$. Which string will it match?A1234B123456C54321DABCDECheck AnswerReveal Answer & ExplanationDiscuss on Board
Q12easyWhat is the purpose of the trim() function in string processing?ATo convert a string to a number.BTo delete vowels from the string.CTo cut the string to a specific length.DTo remove leading and trailing whitespace (spaces, tabs, newlines).Check AnswerReveal Answer & ExplanationDiscuss on Board
Q13mediumIn UTF-8 encoding, how many bytes are typically used to represent a standard English character versus an Emoji?AEnglish characters cannot be stored in UTF-8.B2 bytes for both.C1 byte for English; up to 4 bytes for Emoji.D1 byte for both.Check AnswerReveal Answer & ExplanationDiscuss on Board
Q14hardYou need to build a long HTML report by joining 10,000 small strings together in a loop. Which approach is the most efficient?AUse the + operator.BUse a StringBuilder or StringBuffer.CUse String.concat().DStore the strings in a database first.Check AnswerReveal Answer & ExplanationDiscuss on Board
Q15mediumYou have a multithreaded application where 10 threads are all appending data to a shared log string simultaneously. Which class should you use in Java to ensure no data is corrupted?AStringBuilderBStringBufferCStringDchar[]Check AnswerReveal Answer & ExplanationDiscuss on Board