Professional Documents
Culture Documents
University of Engineering and Technology, Taxila: Final Exam
University of Engineering and Technology, Taxila: Final Exam
University of Engineering and Technology, Taxila: Final Exam
FINAL EXAM
Answer
There are different frameworks that can be used to make Notepad application but I will use Java
Swing framework. Because Java Swing is platform independent and its components are
lightweight.
Components:
The components which are needed for our program are given below:
JFrame
TextField
JTextArea
JPanel
JLabel
JOptionPane
JDialog
JMenuItem
JColorChooser
JCheckBox
JMenuBar
JFileChooser
Clipboard
Problems:
The problem in current Notepad is that it does not autosave text. There are high chance that user
can lose his work if system shuts down unexpectedly. So, this problem needs to be resolved.
Question 2:
Consider the following two classes:
public class A {
public void mOne(int i) {
} public void mTwo(int i) {
} public static void mThree(int i) {
} public static void mFour(int i) {
}}
public class B extends A {
public static void mOne(int i) {
} public void mTwo(int i) {
} public void mThree(int i) {
} public static void mFour(int i) {
}}
Answer the following:
Answer:
CODE:
import java.util.Random;
import java.util.Scanner;
OUTPUT: