Java: Convert Array to List

So, you have an array to use in your application and you wish you could convert that array to a list. Well we have a simple solution for this problem Output We have seen example with String type of Array. Lets see what happens when we try to convert the integer type array to list […]

Java: Use of Comparable and Comparator Interface

Lets get straight to example Problem statement: Create a list of unsorted integers and sort them later First Lets create a list of unsorted integers Output Now, sorting the list Of Integers using Collections.sort() api Full code Output Now, what to do if we want to sort an object. Lets find out Problem statement Create […]

Python: Experiment with Loops

# Use while loop to print a statement multiple times Output count value: 0 count value: 1 count value: 2 count value: 3 count value: 4 # Use if else to print some statements Output Condition is True x is greater than 0 # Use of variable in for loop Output Present letter: w Present […]

Python: Use of variables

# Use two variables to add two numbers and print Output Final result after addition: 30 # Use two variables to concatenate two string and print the final result Output Final result after string concatenation: abcxyz

Python: How to comment code

As a developer, this is one of the most used operations which differs from language to language. Python has a bit different way of commenting line of code # Single Line comment Output This line is not commented # Multiple line comment Output This line is not commented This line is not commented

Python: How to print Hello World and perform basic operations

# Print “Hello World” in console Output Hello World! # Basic math operations on two numbers and print the output Output 5 Output -1 Output 6 Output 2

Java: Hello World