Java Assignment1
Java Assignment1
Java Assignment1
Assignment
First, find the sum of its digits (2+1+2+0+0) i.e. 5, and counts
the number of digits of the given number i.e. 5. We observe
that both are equal. Hence, the number 21200 is an
autobiographical number.
Write a Java program to check whether the given input number
is an autobiographical number or not
4. Write a Java Program to Swap Two Numbers Using Bitwise
Operator
Test Data
Input floating-point number: 25.586
Input floating-point another number: 25.589
Expected Output :
They are different
Class : Student
Data members:
• Name
• Register No
• Department
• 5 marks
Methods:
• Readdata()
• Compute()
• Printgrade()
9.
The account class is the base class, and it has three private member
variables: name, accno, and atype. It contains two member
functions: getAccountDetails() to get the account details from the
user and displayDetails() to display the account details.
14. i) Write a Java program that reads a list of integers from the
user and throws an exception if any numbers are duplicates
15. Explain in detail on the life cycle of thread with neat sketch
i) Write a Java program to create and start multiple
threads that increment a shared counter variable
concurrently.