Java Practical Assignment 2
Java Practical Assignment 2
Java Practical Assignment 2
import java.applet.Applet;
import java.awt.Graphics;
public class First extends Applet{
public void paint(Graphics g){
g.drawString("welcome to applet",100,100);
}
}
/*
<applet code="First.class" width="300" height="300">
</applet>
*/
10. Create a Java Program to check given number is Even or Odd
using Parametrized constructor and Scanner class.
import java.util.*;
class EvenOdd{
int num;
import javax.swing.*;
public class Simple2 extends JFrame //inheriting JFrame
{
JFrame f;
Simple2()
{
JButton b=new JButton("click"); //create button
b.setBounds(130,100,100, 40);