Blog

Queue queue1 = new LinkedList(); Queue queue2 = new PriorityQueue(); class Test { public static void main(String[] args) { Queue<String> queue = new LinkedList(); queue.offer(“Steve”); queue.offer(“Megan”); queue.offer(“Ryan”); queue.offer(“Melissa”); System.out.println(queue); } } Output: [Steve, Megan, Ryan, Melissa]   We can also use the add(Object o) method to add elements to the Queue. In this example, we will…

Read More Queue in Java

In this short Swift code example, I am going to share with you how to load the content of a property file into NSDictionary. And in this particular example, I will load the content of the Info.plist file which is available in our projects. But you can use this approach to load up the content…

Read More Info.plist. Read Content of a Property File in Swift

HashMap<K, V> map = new HashMap<>(); Map<Integer, String> map = new HashMap<>(); class Test { public static void main(String[] args) { Map<Integer, String> map = new HashMap<>(); map.put(1, “Java”); map.put(7, “Python”); map.put(10, “Ruby”); map.put(3, “Kotlin”); System.out.println(map); } } Output: {1=Java, 3=Kotlin, 7=Python, 10=Ruby} class Test { public static void main(String[] args) { Map<Integer, String> map…

Read More Map in Java

HashSet<String> set = new HashSet<>(); Set<String> set = new HashSet<>(); class Test { public static void main(String[] args) { Set<String> set = new HashSet<>(); set.add(“Java”); set.add(“Kotlin”); set.add(“Python”); set.add(“Ruby”); System.out.println(set); } } Output: [Java, Ruby, Kotlin, Python] class Test { public static void main(String[] args) { Set<String> set = new HashSet<>(); set.add(“Kotlin”); set.add(“Java”); set.add(“Ruby”); set.add(“Python”); Set<String>…

Read More Set in Java

LinkedList<String> list = new LinkedList<>(); List<Integer> list = new LinkedList<>(); class Test { public static void main(String[] args) { List<String> list = new LinkedList<>(); list.add(“Steve”); list.add(“Megan”); list.add(“Melissa”); list.add(“Ryan”); System.out.println(list); } } Output: [Steve, Megan, Melissa, Ryan] class Test { public static void main(String[] args) { List<String> list = new LinkedList<>(); list.add(“Steve”); list.add(“Megan”); list.add(“Melissa”); list.add(“Ryan”); List<String>…

Read More LinkedList in Java

ArrayList<String> list = new ArrayList<>(); List<Integer> list = new ArrayList<>(); class Test { public static void main(String[] args) { List<String> list = new ArrayList<>(); list.add(“Steve”); list.add(“Megan”); list.add(“Melissa”); list.add(“Ryan”); System.out.println(list); } } Output: [Steve, Megan, Melissa, Ryan]   Using the addAll() method, we can add all the elements of an existing list to the newly created…

Read More ArrayList in Java

Iterator<T> iterator()   Method Description   public boolean add(E e) It is used to insert an element in this collection.   public boolean addAll(Collection<? extends E> c) It is used to insert the specified collection elements in the invoking collection.   public boolean remove(Object element) It is used to delete an element from the collection.…

Read More Java Collections

In Java, there are three main types of loops: while loops, do-while loops, and for loops. These loop structures are similar in many ways, but they differ in some key aspects that make them useful for different scenarios. This tutorial will introduce you to the concepts and syntax behind Java while and do-while loops. You…

Read More ‘while’ and ‘do-while’ Loops: The Secret to Efficient Java Programming

In this Swift code example, you will learn how to disable UIButton. The quickest way to disable the button in Swift is to simply set the button’s isEnabled property to false. For example button.isEnabled = false.  Below is a complete code example in Swift that demonstrates how to: Create new UIButton, Position button within a view,…

Read More Disable UIButton Example in Swift

This tutorial will guide you through the process of internationalizing your app, which is essential if you want to make your app available in multiple countries. Unlike frameworks such as native Android, Flutter does not have a fixed approach to localization. It offers a lot of flexibility, which can be beneficial if you have experience,…

Read More Internationalization Example in Flutter