0% found this document useful (0 votes)
18 views4 pages

Java Programming Exam Questions Summary

The document outlines a series of Java-related questions categorized by units, covering topics such as Java basics, class definitions, data types, operators, decision making, constructors, arrays, inheritance, multithreading, and applets. Each question includes the year and season it was asked, along with the marks allocated and repetition frequency. A summary of the most repeated questions is also provided, indicating their frequency and the years they appeared.

Uploaded by

vawagav635
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)
18 views4 pages

Java Programming Exam Questions Summary

The document outlines a series of Java-related questions categorized by units, covering topics such as Java basics, class definitions, data types, operators, decision making, constructors, arrays, inheritance, multithreading, and applets. Each question includes the year and season it was asked, along with the marks allocated and repetition frequency. A summary of the most repeated questions is also provided, indicating their frequency and the years they appeared.

Uploaded by

vawagav635
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

Java Sorted Question

UNIT 1: Java Basics (1.1)

Year &
Question Marks Repetition
Season
Summer
List any eight features of Java 4 -
19
Summer
Explain any four features of Java 4 -
22
Summer
Enlist any four features of Java 4 -
23
Repeated 2
Enlist any four features of Java Winter 24 4
times
Summer
State the significance of Java Virtual Machine (JVM) 4 -
24
Explain the concept of platform independence and Summer
4 -
portability with respect to Java language 19
Explain the concept of platform independence in Java and
Summer
discuss how it is achieved. Give example to illustrate the 4 -
24
concept

UNIT 2: Defining a Class, Creating Objects, Accessing Class Members (1.2)

Year &
Question Marks Repetition
Season
Define class and object Winter 19 4 -
Summer
Define the terms with example 4 -
23
Define a class student with int id and string name as data
Summer
members and a method void SetData (). Accept and display 4 -
19
the data for five students
Define a class circle having data members Pi and radius.
Initialize and display values of data members also calculate Winter 19 4 -
area of circle and display it
Define a class employee with data members 'empid', 'name'
Winter 22 4 -
and 'salary'. Accept data for three objects and display it
Define class Employee with members as id and salary.
Summer
Accept data for five employees and display details of 4 -
24
employees getting highest salary
Define class employee having data members as emp_id,
name and salary. Accept and display the data for five Winter 24 4 -
employees
UNIT 3: Java Tokens and Data Types (1.3)

Year &
Question Marks Repetition
Season
Define type casting. Explain its types with syntax and
Winter 19 4 -
example
Describe type casting in java with example Summer 23 4 -
Explain implicit and explicit type conversion with
Winter 23 4 -
example in detail
Write a program to display ASCII value of a number Winter 23 4 -
Define array. List its types Winter 19 4 -
Define array. List its types Summer 24 4 -
Write down the syntax of array declaration, initialization Winter 23 4 -

UNIT 4: Operators and Expressions (1.4)

Year &
Question Marks Repetition
Season
State any four relational operators and their use Winter 22 4 -
Enlist the logical operators in Java Summer 22 4 -
Enlist any two logical operators and two bitwise operators Winter 23 4 -
Explain any two logical operators in Java with example Winter 19 4 -
Describe instance Of and dot ( ) operators in Java with
Summer 19 4 -
suitable example
Give the syntax and example for the following functions:
Summer 22 4 -
min(), sqrt()
Write a program using sqrt() and pow() to calculate the
Winter 24 4 -
square root and power of given number
Write a program to accept four numbers from user using
Winter 24 4 -
command line arguments and print the smallest number
Write a program to demonstrate the use of conditional
Winter 24 4 -
operator and switch case statement

UNIT 5: Decision Making and Looping (1.5)

Year &
Question Marks Repetition
Season
Explain switch case and conditional operator in Java with
Summer 22 4 -
suitable example
Write a Java program to find out the even numbers from 1
Summer 22 4 -
to 100 using for loop
Write a program to check whether the given number is
Winter 22 4 -
prime or not
Year &
Question Marks Repetition
Season
Write a program to find reverse of a number Winter 22 4 -
Write a program to print all the Armstrong numbers from
Summer 23 4 -
0 to 999
Write a program to print all the Armstrong numbers from
Summer 23 4 -
0 to 999

UNIT 6: Constructors, Methods, and Access Control (2.1)

Year &
Question Marks Repetition
Season
Define constructor. List its types Winter 19 4 -
Explain the types of constructors in Java with suitable Summer
4 -
example 19
What is constructor? List types of constructor. Explain Summer
4 -
parameterized constructor with suitable example 22
Explain constructor with suitable example Winter 22 4 -
Define constructor Winter 23 4 -
What happens if you don't define any constructor in a class?
Summer
Can you still create objects of that class? Explain with 4 -
24
example
Explain the concept of argument passing and the usage of
Summer
'this' keyword in Java. Give example to illustrate their usage 4 -
24
and benefits

UNIT 7: Arrays and Strings (2.3)

Year &
Question Marks Repetition
Season
Differentiate between String and String Buffer Winter 19 4 -
Write the difference between vectors and arrays (any four
Summer 22 4 -
points)
Differentiate between string class and string buffer class.
Summer 22 4 -
Explain any four methods of string class
Differentiate between string and string buffer class (any
Summer 23 4 -
four points)
List any four methods of string class and state the use of
Winter 19 4 -
each
Write a program to check whether the string provided by
Winter 22 4 -
the user is palindrome or not
UNIT 8: Inheritance (3.1)

Year &
Question Marks Repetition
Season
List the types of inheritance in Java Summer 19 4 -
List the types of inheritance which is supported by Java Winter 22 4 -
Explain single and multilevel inheritance with proper
Summer 22 4 -
example

UNIT 9: Multithreading (4.2)

Question Year & Season Marks Repetition


Explain the two ways of creating threads in Java Summer 19 4 -
Define thread. Mention 2 ways to create thread Winter 22 4 -
Define Thread. Draw life cycle of Thread Winter 23 4 -
Explain life cycle of thread Winter 19 4 -

UNIT 10: Applets (5.1)

Year &
Question Marks Repetition
Season
Give the syntax of <param> tag to pass parameters to an
Summer 19 4 -
applet
Write a program to accept username in the form of
Winter 19 4 -
parameter and print "Hello <username>"

Summary of Most Repeated Questions:

Question Frequency Years


Enlist any four features of Java 2 times Summer 19, Winter 24
Define class and object 2 times Winter 19, Summer 23
Explain constructor with example 2 times Summer 22, Winter 22
List the types of inheritance in Java 2 times Summer 19, Winter 22

Common questions

Powered by AI

Java enables multitasking through the use of threads. It supports creating threads either by extending the Thread class or by implementing the Runnable interface. Extending the Thread class involves overriding its run() method, while implementing Runnable requires passing a Runnable instance to a Thread object, which then invokes the run() method. These approaches allow concurrent execution of different parts of a program, enhancing efficiency .

In Java applets, the <param> tag is used to pass parameters from a web page to the applet. It is placed within the <applet> or <object> tags in an HTML file, specifying name-value pairs of parameters that the applet can read using methods such as getParameter(). This tag allows external data to be input into the applet, providing flexibility and dynamic interaction with the applet's environment .

Java's platform independence is primarily achieved through the Java Virtual Machine (JVM). The JVM allows Java programs to run on any device or operating system where the JVM is installed, making Java programs platform independent. This is because Java programs are compiled into bytecode, which the JVM interprets at runtime, rather than being compiled into machine-specific code .

Java supports single, multilevel, and hierarchical inheritance but does not support multiple inheritance with classes to prevent complexity and ambiguity. Multiple inheritance is realized through interfaces in Java. By implementing multiple interfaces, Java classes can achieve a form of multiple inheritance while maintaining clear method resolutions without the diamond problem found in other object-oriented languages .

Constructors in Java are special methods used to initialize objects. When a class is defined without a constructor, Java automatically provides a default constructor. This default constructor initializes object members with default values (e.g., null for objects, zero for numeric types) to ensure that the object is in a valid state upon creation .

A thread in Java goes through several states: New, Runnable, Blocked, Waiting, Timed Waiting, and Terminated. In the New state, a thread has been created but not yet started. Once started, it moves to the Runnable state, where it is ready for execution. It may enter the Blocked or Waiting states while waiting for resources or conditions. Timed Waiting is a similar state with a time limit. Finally, the thread reaches the Terminated state after completing execution. These states allow Java to effectively manage multithreading by controlling the timing and order of thread execution .

Implicit type conversion, also known as widening or automatic conversion, occurs when a smaller data type is converted to a larger data type automatically, such as converting an int to a double. Explicit type conversion, or narrowing, requires the programmer to manually cast one data type to another, such as converting a double to an int using a cast operator (e.g., (int)3.14). This can lead to data loss if the larger data type contains more precision or scale than the target type .

The 'this' keyword in Java is used to refer to the current object within an instance method or constructor. It is particularly useful in constructors to differentiate between class fields and parameters that have the same names. For example, this.name refers to the class field, while name refers to the method parameter. 'This' can also be used to invoke other constructors within the class .

The JVM provides a runtime environment for executing Java bytecode. Its significance lies in its ability to allow Java applications to run on any device that has the JVM installed, thus facilitating Java's cross-platform capabilities. It acts as an intermediary layer that abstracts the underlying hardware and operating system, making Java programs universally executable without modification .

The String class is immutable, meaning its objects cannot be modified after creation, leading to the creation of a new object for any modifications. The StringBuffer class, however, is mutable and allows modifications to the object without creating a new instance. Some methods of the String class include length(), charAt(), substring(), and indexOf().

You might also like