---
title: "What if the static modifier is removed from the signature of the main method?"  
description: "What if the static modifier is removed from the signature of the main method?"  
author: "Anonymous User"  
published: 2015-07-20  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/2714/what-if-the-static-modifier-is-removed-from-the-signature-of-the-main-method  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# What if the static modifier is removed from the signature of the main method?

Program compiles. But at runtime throws an error "NoSuchMethodError". This is the case before Java 1. 6 version but for Java 7 and onwards it will throw a **Launch error : Selection does not contain a main type**

## Answers

### Answer by Anonymous User

Program compiles. But at runtime throws an error "NoSuchMethodError". This is the case before Java 1. 6 version but for Java 7 and onwards it will throw a **Launch error : Selection does not contain a main type**


---

Original Source: https://www.mindstick.com/interview/2714/what-if-the-static-modifier-is-removed-from-the-signature-of-the-main-method

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
