• Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
  • Skip to footer
  • Java Tutorial
  • Java Posts
  • Node.js
  • Spring Core
  • Algorithms
  • Docker
  • Blogging
  • Misc
Tech Stack Journal

Tech Stack Journal

Archives for April 2020

How to Convert an Integer to Octal in Java

April 24, 2020 by Admin Leave a Comment

Java wrapper class Integer provides an utility function toOctalString(int) which returns an integer in octal form. However, in this post, we will also see an example on how we can convert integer to octal form mathematically without using Java API classes. If you divide a number with 8, what you get in the reminder is the last digit of its octal form. We repeat this until … [Read more...] about How to Convert an Integer to Octal in Java

How to Reverse an Integer in Java

April 24, 2020 by Admin Leave a Comment

In this example, we will see how to reverse an integer in Java using mathematical equations, StringBuffer and StringBuilder classes. Reverse an Integer in Java using Mathematical Equations To reverse an integer mathematically, first thing what we should do is to take out the last digit as a separate integer. That is possible by dividing the number by 10. After dividing … [Read more...] about How to Reverse an Integer in Java

Quick Sort using Hoare Partition and Lomuto Partition in Java

April 23, 2020 by Admin Leave a Comment

Quick Sort is based on the divide-and-conquer strategy. It is also called a partition exchange sort. It was developed by Tony Hoare in 1959. Steps for Quick Sort: First step in Quick Sort is to choose an element called as pivot. Once the Pivot is selected, we need to reorder the elements so that:all the elements less than the Pivot are placed before Pivot, and elements … [Read more...] about Quick Sort using Hoare Partition and Lomuto Partition in Java

Bubble Sort

April 22, 2020 by Admin Leave a Comment

What is Bubble Sort? Bubble sorting algorithm sort items in a list by repeatedly comparing adjacent elements and swapping them when they are out of order and this process is repeated until it sort the entire list. Bubble Sort Animation A picture is worth a thousand words. I found this interesting bubble sort gif file on wikimedia, which nicely explains without speaking … [Read more...] about Bubble Sort

How to read input from User in Java

April 21, 2020 by Admin Leave a Comment

In this post, we will discuss on how to read input from User using Scanner and InputStreamReader. Scanner(System.in) To read values of known type from standard input, we can use Scanner class. When I say known types, any primitive like int, double, char or a String. Scanner provides various utility methods to read input such as nextShort(), nextFloat(), nextDouble(), … [Read more...] about How to read input from User in Java

Next Page »

Primary Sidebar

More to See

Factorial Program in JavaScript using While Loop

March 24, 2021 By Admin

Flowchart of Nested For Loop

March 22, 2021 By Admin

Secondary Sidebar

Categories

  • Algorithms
  • Blogging
  • Docker
  • Java
  • JavaScript
  • Misc
  • Node.js
  • Programming Concepts
  • Spring Core
  • Windows

Archives

  • April 2021 (1)
  • March 2021 (7)
  • February 2021 (6)
  • January 2021 (1)
  • December 2020 (1)
  • September 2020 (2)
  • August 2020 (5)
  • July 2020 (4)
  • June 2020 (1)
  • May 2020 (4)
  • April 2020 (22)
  • November 2019 (3)
  • September 2019 (2)
  • August 2019 (6)

Footer

  • Privacy Policy
  • Cookie Policy
  • Contact Us
  • About Us

Recent

  • How to Fix – The system cannot find the file C:\ProgramData\Oracle\Java\javapath\java.exe
  • Factorial Program in JavaScript using While Loop
  • Flowchart of Nested For Loop
  • Difference Between Constructor Overloading and Method Overloading in Java
  • Constructor Calling in Java

Search

Copyright © 2021 · Tech Stack Journal · Log in