0% found this document useful (0 votes)
5 views2 pages

Java Programming Concepts and Examples

Uploaded by

ashritdan26
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Java Programming Concepts and Examples

Uploaded by

ashritdan26
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

BCA SEMESTER V - JAVA PROGRAMMING USING

LINUX (2021)
PART A – 2 Marks Each 1. Numeric vs Non-numeric Literal
Numeric literals represent numbers (e.g., 10, 3.14). Non-numeric literals represent text or logical
values (e.g., "Java", true).

2. Operators = and ==
'=' assigns a value, '==' compares two values.

3. Use of this keyword


Refers to the current class object. Used to differentiate instance variables from parameters.

4. Constructor Overloading
Multiple constructors with different parameters in one class.

5. Derived Class
A class that inherits from another using 'extends'.

6. Package
Collection of related classes and interfaces.

7. Exception Handling
Mechanism to handle runtime errors using try, catch, throw, throws, and finally.

8. Delegation Event Model


A mechanism where an event source delegates event handling to a listener.

9. JCheckBox
A GUI component allowing multiple selections.

10. Layout Manager


Manages arrangement of GUI components. Types: FlowLayout, BorderLayout, GridLayout.

11. init() vs start()


init() runs once when applet loads; start() runs whenever applet is active.

12. JDBC API Components


DriverManager, Connection, Statement, ResultSet, SQLException.

PART B – 5 Marks Each 13. Milestones of Java


Simple, Object-Oriented, Platform Independent, Robust, Multithreaded, Portable.

14. Armstrong Number Program


Java code to print Armstrong numbers between 100 and 1000.

15. Declaring Methods


Syntax: returnType methodName(parameters) { }

16. Final Class Example


A final class cannot be inherited.

17. One-Dimensional Array


int[] arr = {10, 20, 30};
18. Two-Dimensional Array
int[][] a = {{1,2,3},{4,5,6}};

19. JCheckBox vs JRadioButton, JList vs JComboBox


CheckBox allows multiple selection; RadioButton single selection.
JList shows multiple items; JComboBox shows one at a time.

20. Applet Tag Example


<applet code="[Link]" width="200" height="200"></applet>

21. Applet to Draw Face


Uses drawOval() and fillOval() in Graphics class.

PART C – 15 Marks Each 22. Branching Statements


if, if-else, switch, break, continue, return – used for conditional flow in programs.

23. Interfaces
Interface defines abstract methods implemented by classes. Supports multiple inheritance.

24. Thread Life Cycle


New → Runnable → Running → Blocked → Terminated.
Demonstrated with Thread priorities.

25. JLabel and JButton


JLabel displays text/images, JButton performs actions. Common in login forms and GUIs.

You might also like