JavaAssignments (1)
JavaAssignments (1)
1. Write simple java program to get person name from command line and
print Hello <Name> on console.
4. Get 4-digit number from user, write a function to calculate sum of digits
of the 4-digit number: Using loop and Using recursion
5. Write a function for factorial and use the function for printing factorial
series like 1 2 6 24 120………
Day2: 23-Sep-2024
*****
****
***
**
*
*
**
***
****
*****
*******
*** ***
** **
* *
*****
***
*
***
*****
1. Write a Java program to create Student class with properties with rollNo,
name, marks. Write printData method for printing Student. Create Default and
parameterized constructor. Generate rollNo automatically using static field.
Day4: 25-Sep-2024
Created overloaded static methods for printing an array of String and Integers
separately. Put these methods in ArrayPrinter class and call from main
ex.
public static void printArray(int[] arr) {}
public static void printArrray(String[] arr) {}
Day5: 26-Sep-2024
Input +91-988-162-8598
Input +919881628598
Input 9881628598
Menus.
1. Display stock
3. Display bill
Day6: 27-Sep-2024
Revise all the Enum, Date and Assocaiation examples from class
Day7: 28-Sep-2024
Topics Covered: Inheritance, abstract class, final variable, final methods,
final class, upcasting, down casting, overriding, co-varient return type.
Object class methods like getClass and toString. Wrapper classes boxing
and un boxing.
1. double calculateArea();
2. double calculatePerimeter();
Call the draw method of circle with specific circle reference after
down casting from Shpae reference