JAVA PROGRAMMING, MODEL EXAMINATION, SEMESTER 5(2020-23), NOV 2022

 

SAINTGITS COLLEGE OF APPLIED SCIENCES

          PATHAMUTTOM, KOTTAYAM

 

Model Examination, NOV 2022

PG Department of Computer Applications and AI,Semester 5

Java Programming Using Linux

Total : 80 marks                                                                    Time: 3 hours

Section A

Answer any 10 questions. Each question carries 2 marks.

(Write in not less than a paragraph)

1.    Define byte code and JVM.

Java bytecode is the instruction set for the Java Virtual Machine.

As soon as a java program is compiled, java bytecode is generated.  java bytecode is the machine code in the form of a .class file. With the help of java bytecode we achieve platform independence in java.

2.    List out the data types in JAVA.

  • boolean data type
  • byte data type
  • char data type
  • short data type
  • int data type
  • long data type
  • float data type
  • double data type

 

3.    Define method overloading.

Method overloading is a form of polymorphism in OOP. Polymorphism allows objects or methods to act in different ways, according to the means in which they are used. One such manner in which the methods behave according to their argument types and number of arguments is method overloading.

4.    Compare interface and class.

Key

Class

Interface

1

Supported Methods

A class can have both an abstract as well as concrete methods.

Interface can have only abstract methods. Java 8 onwards, it can have default as well as static methods.

2

Multiple Inheritance

Multiple Inheritance is not supported.

Interface supports Multiple Inheritance.

3

Supported Variables

final, non-final, static and non-static variables supported.

Only static and final variables are permitted.

4

Implementation

A class can implement an interface.

Interface can not implement an interface, it can extend an interface.

5

Keyword

A class is declared using class keyword.

Interface is declared using interface keyword.

 

5.    Write the syntax for creating one dimensional and two-dimensional array in Java.

dataType [] variableName  

variableName= new dataType[size]

datatype[][] variableName

variableName=new int[rowSize][columnSize]

6.    Define multithreading in Java.

Multithreading in Java is a process of executing multiple threads simultaneously.

A thread is a lightweight sub-process, the smallest unit of processing. Multiprocessing and multithreading, both are used to achieve multitasking.

 

7.    List out event sources.

An event can be defined as changing the state of an object or behavior by performing actions. Actions can be a button click, cursor movement, keypress through keyboard or page scrolling, etc. 

The java.awt.event package can be used to provide various event classes

Events are generated from the source. There are various sources like buttons, checkboxes, list, menu-item, choice, scrollbar, text components, windows, etc., to generate events.

 

 

8.    Define the syntax to create JButton in Java Swing.

Java JButton

 

The JButton class is used to create a labeled button that has platform independent implementation. The application result in some action when the button is pushed. It inherits AbstractButton class.

Button()

It creates a button with no text and icon.

JButton(String s)

It creates a button with the specified text.

JButton(Icon i)

It creates a button with the specified icon object.

 

 

9.    What is thread priority.

 

Each thread has a priority. Priorities are represented by a number between 1 and 10. In most cases, the thread scheduler schedules the threads according to their priority (known as preemptive scheduling).

10.  List out the applet methods.

The applet life cycle can be defined as the process of how the object is created, started, stopped, and destroyed during the entire execution of its application. It basically has five core methods namely init(), start(), stop(), paint() and destroy().These methods are invoked by the browser to execute.

11.  Define the applet tag.

 

<applet attribute1 attribute2....>

   <param parameter1>

   <param parameter2>

   ....

</applet>

12.  Define JDBC architecture

 

                                                                                                            (10 x 2 = 20 Marks)

Section B

Answer any 6 questions. Each question carries 5 marks.

(Write in not less than 2 pages)

 

13. Describe the features of JAVA.

List out nine features and explanation (5)

14.  Define class and objects.

Definition of both and an example (2.5 marks each)

 

15. What is a constructor and mention its types.

Definition-2 marks

Define default and parameterized with examples-3 marks

16. Explain the thread life cycle.

Diagram -2 marks

Stages-3 marks

17. Write about the packages in Java.

Definition -2 marks

Compare inbuilt and user defined -2 marks

List out the uses. - 1marks

18. Define delegation event modelling and describe the event classes.

Define delegation event model and its components- 2 marks

List out the event classes -3 marks

 

19.  Define JLabel and JTextField with examples. -

    2.5 marks each

20.  Define applet and Graphics class.

            Applet -2. Marks

             Graphics class- 3 marks

21. Explain the JDBC Drivers in detail.

    Definition- 1 mark

    Types – 1 mark each

 

            (6 x 5 = 30 Marks)

 

Section C

Answer any 2 questions. Each question carries 15 marks

 

22.  Define object-oriented programming. Explain OOP s concepts in detail.

Definition- 5 marks

Concepts -10 marks

23. Explain inheritance with examples.

Definition- and diagram - 3 marks

 Explanation -4 marks each

 

24.  Write about the exception handling mechanism in Java-

    Definition and explanation-3 marks

     Explanation each block -3 each

25. Explain about the Layout managers in detail.

            Definition – 3 mark

            Explanation -6 marks each

                                                                                                

            (15 x 2 = 30 Marks)

 

 

 

 

Comments

Popular posts from this blog

UG, S1 BCA, First internal examination, Introduction to Problem Solving and Web Designing, September 2024