---
title: "Can you write a Java class that could be used both as an applet as well as an application?"  
description: "Can you write a Java class that could be used both as an applet as well as an application?"  
author: "Anonymous User"  
published: 2015-05-04  
updated: 2020-09-16  
canonical: https://www.mindstick.com/interview/2481/can-you-write-a-java-class-that-could-be-used-both-as-an-applet-as-well-as-an-application  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# Can you write a Java class that could be used both as an applet as well as an application?

Yes. Add a main() method to the applet.

## Answers

### Answer by Anonymous User

Yes. Add a main() method to the applet.


---

Original Source: https://www.mindstick.com/interview/2481/can-you-write-a-java-class-that-could-be-used-both-as-an-applet-as-well-as-an-application

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
