Skip to content

JakTech

  • Home
  • Java
  • Spring
  • AWS
  • Interview Questions
  • Software Engineering
  • Network Definitions
  • Forum
6th April 2020

Difference between Abstract Classes and Interfaces

There are key differences between an interface and abstract methods and this article will explain those details with examples. Interface An interface is a contract that an object agrees to when it implements the interface. An interface is an empty shell and only contains the signatures of methods. the methods do not have bodies. Abstract Class An abstract class differs...

Categories Java Comments: 0
6th April 2020

SOLID Principles

The SOLID principles is an acronym for the five design principles in OOP Programming. Single Responsibility Principle A class should only have a single responsibility over a single part of the functionality provided by the software. The term responsibility is referring to the fact that a class should only have a single reason to change. For example, a Person class...

Categories Java Comments: 0
5th April 2020

Difference between String , StringBuilder and StringBuffer

String, StringBuidler and StringBuffer are all different methods of creating and using Strings in Java. This article explains the difference between them and when you should use them in Java. String String in Java represents character Strings. They are immutable meaning that is thread safe, however every time there are any manipulations performed on the String, a new String object...

Categories Java Comments: 0
4th April 2020

OOP Principles. Abstraction, Inheritance, Polymorphism, Encapsulation

Abstraction Although officially according to Oracle Abstraction is not one of the Three OOP Principles, it is worth mentioning as it is still an important part of OOP. Abstraction is the idea of conceptualising something that is complex in a simpler form. For example a car is a very complex objects of thousands of parts all working together. But as...

Categories Java Comments: 3
3rd April 2020

Max Subarray Problem – Kadane’s Algorithm (Dynamic Programming)

Problem The max subarray problem is a problem where you have to find the contiguous subarray (containing at least one number) which has the largest sum, and return the sum. The problem can be found here Test Cases Input Output [-2,1,-3,4,-1,2,1,-5,4] 6 Solution The way to solve this problem is use Kadane’s algorithm: The way that this algorithm works is...

Categories Java/Leet Code Comments: 0
2nd April 2020

How to split an int number into separate digits?

How to split an int number into separate digits is a surprisingly common question and there is no native method of doing this in Java. What we are trying to achieve is given the number 524, how can we split the number into it’s individual digits e.g. 5, 2, 4. The simplest way of doing this is through using the...

Categories Java/Leet Code Comments: 0
2nd April 2020

Clean Code Book – Chapter 2: Meaningful Names

This chapter focusses on the best practices for naming things when writing code. Use intention revealing names Rather than giving ambiguous names to variables such as int x = 4 and having arbitrary numbers in the code such as if (x == 4), these names should all be changed to more explicit. By having ambiguous names, it gives the codes...

Categories Books Comment: 1
1st April 2020

Clean Code Book – Chapter 1: Clean Code

These are some important notes from the clean code book chapter 1. Most of this chapter was introductions and definitions about what clean code is. Later chapters focus more on how to write clean code. It is important for programmers to not bend to the will of managers who don’t understand the risk of writing poor quality code. Managers want...

Categories Books Comments: 0
31st March 2020

Find maximum for every window of size k in an array – Google Interview Question

Problem This is a hard problem that was asked by Google in a software engineering interview. Given an array of integers and a number k, where 1 <= k <= length of the array, compute the maximum values of each subarray of length k and print the max values. Test Cases Input Output [10, 5, 2, 7, 8, 7] 10,...

Categories Leet Code Comment: 1
29th March 2020

Maps and HashMaps

The Map interface is an object that maps keys to values. Methods putIfAbsent() The putIfAbsent() method attempts to add a key-value pairing to the map if it is not already present. If the key is not present, it adds it to the map and then returns null. If the key is present, it will not update the value, but just...

Categories Java Comments: 0

Posts navigation

  • «
  • 1
  • 2
  • …
  • 5
  • 6
  • 7
  • 8
  • 9
  • »
Stuck on a problem? Ask your question here!

Recent Posts

  • AWS Developer Associate Cheat Sheet and Questions
  • How to use different SSH Keys with different GitLab repositories [SOLVED]
  • [ANSWERS] The Most Common Java Software Engineer Questions – Part 1
  • The Most Common Java Software Engineer Questions – Part 1
  • How To Make JotForm Table Read Only

Tags

Airtable Airtable Pro Angular Automator AWS Book Button Clean Code CLI Coding Interview Controller Docker DualSense DynamoDB Email Git gitlab gitlab-ci HashMap HTTP IntelliJ Interview Questions Jackson Java Java 8 Java Streams JotForm Lambda Leet Code Mac Map Maven Object Mapper OS X PS5 Screenshots Secrets Manager Shortcuts Siri Spring Spring Boot SSH Stadia String Testing

©2021 JakTech

Back To Top