-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.java
More file actions
36 lines (34 loc) · 932 Bytes
/
main.java
File metadata and controls
36 lines (34 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//import java.util.Scanner;
/*class main{
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int num=input.nextInt();
int sum=0;
System.out.print("Reversed number: ");
while(num>0){
int n=num%10;
System.out.print(n);
sum=sum+n;
num=num/10;
}
System.out.println("\nSum of digits: "+sum);
}
}*/
import javax.swing.*;
import java.awt.*;
public class main extends JFrame {
public main() {
setTitle("Hello Applet Replacement");
setSize(300, 200);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public void paint(Graphics g) {
super.paint(g);
g.drawString("Hello Application!", 50, 100);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
new main().setVisible(true);
});
}
}