Core Java Question Bank
Core Java Question Bank
7. What is exception?
8. What is package?
10. A final keyword can not be overriden state true/false and justify.
22. Which class and interface are at topmost position in Exception hierarchy.
23. Write a java program to delete the files having extension. txt. (Use command line
arguments)
24. Write a java program using swing to accept the details of project (PID, P Name, duration)
from user and display it by clicking on a button.
25. Define an abstract class Shape with abstract method area ( ). Write a java program to
calculate area of Triangle.
26. Write a java program to change the text color of Lable to Red by clicking on a button.
28. How to create and access package in a program? Explain with an example.
34. Define an interface shape with abstract method area( ). Inherit interface shape into the class
traingle. Write a Java Program to calculate area of Triangle.
36. Define user define exception zeronumber Exc. Write a Java program to accept a number
from user. If it is zero then throw user define exception "Number is zero" otherwise
calculate the sum of first & last digit of given number. (use Static Keyword).
37. Write a Java program to accept n number from user & store only perfect numbers into array
& display that array.
39. Define a class Emp with a member Eid and display() method, inherit EmP class into the Emp
Name class, Emp Name class having a member Ename & display ( ) method. Write a Java
program to accept details of employee [Eid, Ename] & display it. (Use super keyword).
40. Write a Java Program to copy the contents form one file into another file. While copying,
change the case of cell the alphabets & replace all the digital by '*'.