Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Practice InterviewNew Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

Core Java Interview Questions and Answers

Ques. Can you write a Java class that could be used both as an applet as well as an application?
Ans. Yes. Add a main() method to the applet.

import java.awt.*;
import java.applet.*;
import java.util.*;

public class AppApp extends Applet
{
	public void init()
	{
		add(new TextArea("Welcome to withoutbook.com"));
		String ar[]=new String[2];
		ar[0]="Welcome to withoutbook.com";
		main(ar);		
	} 
	
	public void main(String args[])
	{
		System.out.println(args[0]);
	}
}
Is it helpful? Yes No

Most helpful rated by users:

©2018 WithoutBook