---
title: "Dynamic and Static Typing"  
description: "Dynamic and Static Typing"  
author: "Tarun Kumar"  
published: 2015-09-16  
updated: 2020-09-18  
canonical: https://www.mindstick.com/interview/22830/dynamic-and-static-typing  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 2 minutes  

---

# Dynamic and Static Typing

Static typed languages are those in which type checking is done at compile-time, whereas dynamic typed languages are those in which type checking is done at run-time. Static typed variables need not be defined before they’re used. This implies that static typing has to do with the explicit declaration (or initialization) of variables before they’re employed. \
Objective-C is a dynamically-typed language, meaning that you don’t have to tell the compiler what type of object you’re working with at compile time. Declaring a type for a varible is merely a promise which can be broken at runtime if the code leaves room for such a thing. You can declare your variables as type id, which is suitable for any Objective-C object.

## Answers

### Answer by Tarun Kumar

Static typed languages are those in which type checking is done at compile-time, whereas dynamic typed languages are those in which type checking is done at run-time. Static typed variables need not be defined before they’re used. This implies that static typing has to do with the explicit declaration (or initialization) of variables before they’re employed. \
Objective-C is a dynamically-typed language, meaning that you don’t have to tell the compiler what type of object you’re working with at compile time. Declaring a type for a varible is merely a promise which can be broken at runtime if the code leaves room for such a thing. You can declare your variables as type id, which is suitable for any Objective-C object.


---

Original Source: https://www.mindstick.com/interview/22830/dynamic-and-static-typing

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
