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

Core Java Remedial Exam Questions

This document appears to be an exam for a Core Java course, containing instructions and 6 questions across two sections. The first section includes 7 short questions on topics like JDK, bytecodes, exceptions, typecasting, recursion, wrapper classes, and class vs instance methods. The second section includes longer questions asking students to explain concepts like applets, synchronization, vectors, and layout managers with examples, or write programs demonstrating flags, file I/O, and frames. The exam provides space for the student's seat number and enrollment number and is dated June 21, 2014.

Uploaded by

ops gaha
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)
11 views2 pages

Core Java Remedial Exam Questions

This document appears to be an exam for a Core Java course, containing instructions and 6 questions across two sections. The first section includes 7 short questions on topics like JDK, bytecodes, exceptions, typecasting, recursion, wrapper classes, and class vs instance methods. The second section includes longer questions asking students to explain concepts like applets, synchronization, vectors, and layout managers with examples, or write programs demonstrating flags, file I/O, and frames. The exam provides space for the student's seat number and enrollment number and is dated June 21, 2014.

Uploaded by

ops gaha
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

Exam Seat No:________________ Enrollment No:___________________

[Link] UNIVERSITY
Wadhwan City
Subject Code : 5CS03CJP1 Summer Examination-2014 Date: 21 /06/2014
Subject Name:- Core Java
Branch/Semester:-MCA (Lateral) /I Tim[Link] To 1:00
Examination: Remedial
Instructions:-
(1) Attempt all Questions of both sections in same answer book / Supplementary
(2) Use of Programmable calculator & any other electronic instrument is prohibited.
(3) Instructions written on main answer Book are strictly to be obeyed.
(4)Draw neat diagrams & figures (If necessary) at right places
(5) Assume suitable & Perfect data if needed
_______________________________________________________________________________________________________________________
SECTION-I

Q.1 Attempt the Following Questions: (07)


(1) What is JDK?
(2) What are javas Byte Codes?
(3) Difference between Checked and Unchecked Exception
(4) What is Typecasting?
(5) What is recursion?
(6) What is Wrapper class?
(7) What is different between class method and instance method?

Q.2 Attempt the Following Questions: (14)


(1) Explain the java oops concepts with examples.
(2) Write a program to find out that odd and even number with odd sum and even sum.
(3) Explain the use of finalize method with example.
OR
Q.2 Attempt the Following Questions: (14)
(1) Discuss pass by value and pass by reference in Java with proper example.
(2) What is a Constructor? Different between Method Overload & Method Overriding.
(3) Write a program to find out that given number is prime or not using command line

Q.3 Attempt the Following Questions: (14)


(1) Explain Access Modifier with suitable example.
(2) What is Package? Write a Step to create package with suitable examples
OR
Q.3 Attempt the Following Questions: (14)
(1) Discuss about initializer blocks and class initializer blocks.
(2) Explain nested class with suitable examples.

Page 1 of 2
21
SECTION-II
Q.4 Attempt the Following Questions: (07)
(1) What is Appletviewer?
(2) What is synchronization?
(3) What is a Vector?
(4) What is Super keyword?
(5) What is the difference between setCharAt and insert?
(6) What do you mean by AWT?
(7) What is the different between checkbox and checkboxgroup?
Q.5 Attempt the Following Questions: (14)
(1) Explain the uses of keywords Try, Catch, throw, throws and Finally with example
(2) What is Collection Framework? Explain set Interface with example.
(3) Write an applet to draw National flag with color.
OR
Q.5 Attempt the Following Questions: (14)
(1) Explain FileWriter and the PrintWriter Classes with examples.
(2) Explain List and Map Interface with examples.
(3) Write an Applet program to create Frame with Title name.
Q.6 Attempt the Following Questions: (14)
(1) Explain Event Delegation Model with example
(2) What is an Applet? Explain Applet life cycle with examples
OR
Q.6 Attempt the Following Questions: (14)
(1) What is Layout Manager? Explain FlowLayout, CardLayout and GridLayout with examples.
(2) What is a Thread? Explain Thread life cycle and Thread priority.

*******21***14****S

Page 2 of 2
21

Common questions

Powered by AI

In Java, parameter passing is strictly 'pass by value.' This means that when a variable is passed to a method, a new copy of the variable is created in memory. For primitive data types, the actual value is passed, whereas for object references, the reference is copied. This might seem similar to 'pass by reference,' but changes in the method do not reflect back to the original reference outside the method. Practically, this means developers need to be cautious with modifications, as objects' internals can be altered through their references, but reassignment of the reference itself inside a method won't affect the outside context .

In Java, checked exceptions are exceptions that must be either caught or declared in the method's throws clause, meaning the compiler checks at compile time whether these exceptions are properly handled. Unchecked exceptions, also known as runtime exceptions, do not require explicit handling in the code and are checked at runtime. The implication is that while checked exceptions encourage robust error handling by enforcing compile-time checking, unchecked exceptions allow for more flexibility but can lead to runtime errors if not properly anticipated and handled by the developer .

Appletviewer is a tool for testing and running Java applets without a web browser, providing a standalone environment that is more convenient for development and debugging of applets. AWT (Abstract Window Toolkit) is a Java package that provides GUI components, event handling classes, and layout managers for building platform-independent windowed applications. While Appletviewer is used specifically for applet execution during development, AWT is employed for creating general-purpose applications that need graphical user interfaces, supporting common components like buttons and text fields .

Java's Collection Framework standardizes and unifies the way collections of objects are handled, offering higher abstraction than arrays and legacy data structures. It provides interfaces and classes (e.g., List, Set, Map) for managing groups of objects, promoting reusability and adaptability through polymorphic algorithms like sorting and searching. This framework enhances data handling by offering performance-tuned implementations (e.g., ArrayList, HashSet), thereby improving programming productivity and reducing the burden of dealing with data structure specifics manually. As a result, it significantly impacts efficient data management in Java .

The 'finalize' method in Java was used as a mechanism to perform cleanup operations before an object is garbage collected, such as releasing non-memory resources like file handles. However, its use has become largely discouraged in favor of try-with-resources and explicit resource management, because finalize can cause performance issues and its timing of execution is unpredictable. Nonetheless, it was historically a way to ensure an object could perform final clean-up tasks. For example, overriding `protected void finalize()` in a resource-managing class might have been used to clean up before garbage collection .

A thread in Java goes through several states: New, Runnable, Running, Blocked/Waiting, and Terminated. Initially, a thread is in the 'New' state. Once started, it moves to the 'Runnable' state, where it might be waiting to acquire CPU time. In 'Running,' it executes its task. If waiting for resources, it moves to 'Blocked/Waiting.' Upon task completion, it terminates. Thread priority, ranging from MIN (1) to MAX (10), hints to the scheduler on the order of execution preference. Higher-priority threads are more likely to be executed before lower-priority ones but actual scheduling can vary depending on the JVM and platform .

In Java, the 'super' keyword is used to access methods and constructors of a parent class. It enables the calling of superclass methods from a subclass that overrides them, facilitates usage of superclass constructors to initialize fragments of an instance, and provides a way to refer to an instance variable's superclass version if overridden in the child class. This functionality is crucial for leveraging inheritance in Java, allowing a subclass to enhance or modify inherited properties and behaviors while maintaining an intrinsic link to its superclass .

In Java, method overloading occurs when multiple methods have the same name but differ in the type or number of their parameters within the same class. Overloaded methods are resolved at compile time. For example, two methods `add(int a, int b)` and `add(double a, double b)` are overloaded methods. Method overriding, on the other hand, happens when a subclass has a method with the same name, return type, and parameters as a method in its superclass, allowing runtime polymorphism. For instance, if class A has a method `void display()` and subclass B overrides it with `void display()`, this is method overriding. Overloading adds more flexibility to methods while overriding allows specific behavior for subclass instances .

The Event Delegation Model in Java is used to handle events in a more efficient way by separating event handling logic from the UI components generating the events. This model uses event listeners registered with event sources (components) to capture and handle events. When an event occurs, the source notifies all registered listeners automatically, enabling centralized and reusable event handling code. This delegation approach reduces coupling between UI components and their handling logic, making it easier to manage events in complex GUIs .

Initializer blocks in Java are blocks of code inside a class that execute during the instance creation process, similar to constructors, but without parameters. Class initializer blocks, marked with 'static', initialize static variables and run when the class is loaded. Both initializer blocks and constructors can initialize fields, but initializer blocks offer an advantage by allowing shared initialization code across multiple constructors. Constructors, unlike initializer blocks, can accept parameters for more controlled and specific initialization, suiting different instantiation needs. Therefore, both play complimentary roles in the initialization lifecycle of Java objects .

You might also like