---
title: "Difference between static methods and instance methods in Java"  
description: "Difference between static methods and instance methods in Java"  
author: "Royce Roy"  
published: 2015-04-15  
updated: 2015-04-15  
canonical: https://www.mindstick.com/forum/23099/difference-between-static-methods-and-instance-methods-in-java  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# Difference between static methods and instance methods in Java

What is [difference between static](https://www.mindstick.com/interview/33896/difference-between-static-readonly-and-constant-in-c-sharp) methods and [instance methods](https://www.mindstick.com/forum/161894/what-s-the-difference-between-staticmethod-classmethod-and-instance-methods) in [Java](https://www.mindstick.com/articles/12214/web-development-company-in-india-laid-on-the-foundation-of-concrete-java-programming)

## Replies

### Reply by Anonymous User

**[Static](https://www.mindstick.com/articles/12098/the-static-keyword-the-static-methods) Method:**1)A method i.e. declared as static is known as static method. 2)Object is not required to call static method. 3)Non-static ([instance](https://www.mindstick.com/forum/155658/testing-connection-to-cloud-sql-instance-with-a-mysql-client-from-vm-instance)) members cannot be accessed in static context (static method, static block and static nested class) directly. 4)For example:

```
 public static int cube(int n){ return n*n*n;}
```

\
**Instance Method:**1)A method i.e. not declared as static is known as instance method.2)Object is required to call instance [methods](https://www.mindstick.com/articles/13060/runny-nose-remedy-methods-that-work-best).3)static and non-static variables both can be accessed in instance methods.4)For example:

```
 public void msg(){...}.
```


---

Original Source: https://www.mindstick.com/forum/23099/difference-between-static-methods-and-instance-methods-in-java

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
