The document contains a series of exam questions from various semesters related to Java programming. It covers topics such as features of Java, constructors, classes and objects, access specifiers, data types, and various Java methods. Additionally, it includes programming tasks that require the implementation of classes, methods, and operations on data structures like arrays and vectors.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
0 views
Java1
The document contains a series of exam questions from various semesters related to Java programming. It covers topics such as features of Java, constructors, classes and objects, access specifiers, data types, and various Java methods. Additionally, it includes programming tasks that require the implementation of classes, methods, and operations on data structures like arrays and vectors.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9
Summer-2019
1)List any eight features of Java.
2)Name the wrapper class methods for the following: (i) To convert string objects to primitive int. (ii) To convert primitive int to string objects.
3)Explain the concept of platform independence
and portability with respect to Java language. 4)Explain the types of constructors in Java with suitable example. 5)Define a class student with int id and string name as data members and a method void SetData ( ). Accept and display the data for five students. 6)Describe instance Of and dot (.) operators in Java with suitable example. 7)Explain the four access specifiers in Java. 8)Describe the use of any methods of vector class with their syntax. 9)Explain the command line arguments with suitable example. Winter-2019 Define Constructor. List its types. Define class and object. List access specifiers in Java.
Differentiate between String and String
Buffer. Define a class circle having data members Pi and radius. Initialize and display values of data members also calculate area of circle and display it. Define type casting. Explain its types with syntax and example. Differentiate between array and vector. List any four methods of string class and state the use of each. Write a program to create vector with five elements as (5, 15, 25, 35, 45). Insert new element at 2nd position. Remove 1st and 4th element from vector. Summer-2022
1) Enlist the logical operators in Java.
2)Explain any four features of Java. 3)Write the difference between vectors and arrays. (any four points) 4)Explain any four visibility controls in Java. 5)Explain switch case and conditional operator in java with suitable example. 6)What is constructor? List types of constructor. Explain paramaterized constructor with suitable example. 7)Explain the difference between string class and string buffer class. Explain any four methods of string class Winter-2022 1)State any four relational operators and their use. 2)Enlist access specifiers in Java. 3) Explain constructor with suitable example. 4)Write a program to check whether the given number is prime or not. 5)Define a class employee with data members ‘empid’, ‘name’ and ‘salary’. Accept data for three objects and display it. 6)Write a program to find reverse of a number. 7)Write all primitive data types available in Java with their storage sizes in bytes. 8)Write a program to add 2 integer, 2 string and 2 float values in a vector. Remove the element specified by the user and display the list. 9)Develop a program to create a class ‘Book’ having data members ‘author’, ‘title’ and ‘price’. Derive a class ‘BookInfo’ having data member ‘stockposition’ and method to initialize and display the information for three objects. 10) Compare array and vector. Explain elementAT( ) and addElement( ) methods. 11) Write a program to create a class ‘salary’ with data members ‘empid’, ‘name’ and ‘basicsalary’. Write an interface ‘Allowance’ which stores rates of calculation for da as 90% of basic salary, hra as 10% of basic salary and pf as 8.33% of basic salary. Include a method to calculate net salary and display it. 12) Write a program to check whether the string provided by the user is patindrome or not. Summer-2023 1) Define the terms with example i) Class ii) Object
2) Enlist any two access specifier with syntax.
3) Give use of garbage collection in java.
4) Describe type casting in java with example.
5) Differentiate between string and string buffer class (any
four points)
6) Write a program to print all the Armstrong numbers
from 0 to 999.
7) Describe any four features of java.
8) Explain any four methods of vector class with example.
9) Write a program to copy all elements of one array into
another array.
10) Explain constructor with its type. Give an example
of parameterized constructor. Winter-2023 1)Enlist any two logical operators and two bitwise operators.
2) Define constructor.
3)Write down the syntax of array declaration,
initialization.
4)Differentiate between method overloading and
method overriding.
5)Explain implicit and explicit type conversion with
example in detail.
6)Write a program to show the use of copy
constructor.
7)Explain vector with the help of example. Explain
any 3 methods of vector class.
8)Write a program to print the sum, difference and
product of two complex numbers by creating a class named “Complex” with separate methods for each operation whose real and imaginary parts are entered by user. Summer-2024 1)State the significance of Java Virtual Machine (JVM) in the Java programming environment.
2) Define array. List its types.
3)Explain the concept of platform independence in Java and discuss how it is achieved. Give example to illustrate the concept.
4) What happens if you don't define any constructor in
a class?Can you still create objects of that class? Explain with example.
5)Define a class employee with data members ‘empid’,
‘name’ and ‘salary’. Accept data for three objects and display it.
6)Explain any two logical operators in Java with
example. 7)What is constructor? List types of constructor. Explain parameterized constructor with suitable example.
8)Write a program to define class Employee with
members as id and salary. Accept data for five employees and display details of employees getting highest salary. Winter-2024 1) Enlist any four features of java. 2) Write a program using sqrt( ) and pow( ) to calculate the square root and power of given number. 3) Write a program to accept four numbers from user using command line arguments and print the smallest number. 4) Define a class employee having data members as emp_id, name and salary. Accept and display the data for five employees. 5) Enlist and explain four access specifiers in java. 6) Write a program to demonstrate the use of conditional operator and switch case statement. 7) Explain garbage collection mechanism in java with suitable example. 8) Write a program to check whether entered number is Armstrong number or not. 9) Describe the use of any methods of vector class with their syntax. (Any six methods)