
In idiomatic Java, there is whitespace before a.

#Letters on phone keypad code
It's easier to write code that correctly handles an empty list than to special-case null checks. Short-circuiting the loop might make it easier to read.Įmpty lists would be better than using null. The code is hard to read, which means it's easy to introduce bugs and hard to notice them. The type of list is an implementation detail.Ī loop is the wrong structure to build this map. Using an integer to magically act as characters makes the method harder to read. Variable names should clearly indicate the value they hold. Let the client decide what to do with it.Īx and hm are very poor variable names. KeypadDemo() should return the Map, not print it. Readers have to worry about a loop and three branches instead of a simple, static mapping. This method is doing a simple thing in a complex way. Complexity leads to bugs, and should be avoided where possible. My primary concern with this method is that it is hard to read and understand.

Accordingly, this review is of the method by itself. It's not possible to say if this method is a good or useful abstraction without context which you have not provided. But since, I'm learning about Collections in java so wanted to know whether my choice of the data structure is up to the mark or not.

The reason for this is that since it was asked in timed-coding test so I don't want to write it again and again. Things which I know and don't want to implement: I want to know if the data structure and methodology which I implemented is good or does it need some more improvements. After trying various options I came up with the below Code. The first idea which came to my mind is using a HashMap. Oracle and Java are registered trademarks of Oracle and/or its affiliates.Īll other products and services are the registered trademarks of their respective holders.I was trying to code the phone keypad characters with its numbers.
#Letters on phone keypad windows
Microsoft, Active Directory, Office, Excel, Outlook, and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Linux ® is the registered trademark of Linus Torvalds in the U.S.
#Letters on phone keypad mac
IPhone, iPad, iPod, Mac, mac OS, App Store, Objective–C, and Xcode are trademarks of Apple Inc., registered in the U.S. and other countries and is used under license. IOS is a trademark or registered trademark of Cisco in the U.S. Intel, the Intel logo, Intel Core and Core Inside are trademarks of Intel Corporation in the U.S. Eclipse is a trademark of Eclipse Foundation, Inc. Stretto ™ and the Stretto Platform ™ are trademarks of CounterPath Corporation.Īndroid and Google Play are trademarks of Google Inc. In no case will CounterPath, its employees, officers or directors be liable for any incidental, indirect or otherwise consequential damage or loss that may result after the use of this publication.ĬounterPath ®, Bria ®, X-Lite ®, and the ® logo are registered trademarks of CounterPath Corporation. CounterPath makes no warranty regarding the content of this document, including-but not limited to-implied warranties of fitness for any particular purpose. Users of this material must determine for themselves whether the information contained herein applies to a particular IP-based networking system. The content of this publication is intended to demonstrate typical uses and capabilities of Bria for iOS from CounterPath. This document contains information proprietary to CounterPath, and shall not be used for engineering, design, procurement, or manufacture, in whole or in part, without the consent of CounterPath.

Bria User Guide - iOS - for Bria Solo and Bria TeamsĬopyright © 2023 CounterPath an Alianza Company.
