Category: Java

  • Kindly solve this project

    All detiles inside files

  • What are the basic pillars of oops

    In Java there are these types of pillars of oops 1. Abstraction 2. Inheritance 3. Polymorphism 4. Encapsulation

  • General Project Instructions for Program 1 and Program 2

    This project enables students to integrate the covered knowledge and skills in this

    course.

    1. Group Size = (Min 4 Max 5) members.

    2. The team leader will be responsible for the final project submission.

    3. Work distribution for all members in each group must be included in the final

    report; failing to include it will result in a deduction of 1 point.

    4. Submit all required files:

    Project Report (Word and PDF) on the blackboard before 4th May 2026.

    5. Marks will be given based on your submission and the quality of the content.

    6. Each group must come up with a unique solution for the project based on the

    description below for each program 1 and program 2.

    7. Write a Java program to demonstrate the system’s functionality.

    8. You should copy and paste the “Java code”.

  • DONT take screenshots of your Java code.
  • It must be an editable code.
  • 9. Take a screenshot of your output and paste it with the related questions.

    10. Include comments to all parts of your code to explain the purpose of each class,

    method, and important code block, as well as a brief paragraph in front of every

    major part of your code. Failing to include it will result in a 1-point deduction for

    each program.

  • Java ?

    1: ? 1 5

    :
    ? 1 5 for

    ? :

    • ; for
    • { }
    • i <= 5 i < 5

    ?:

    for(int i = 1 i <= 5; i++)
    System.out.println(i);

    : ; 1


    2:

    :
    ?

    ? :

    • (int)
    • "+" "+"

    ?:

    int a = 5;
    int b = 3;
    System.out.println(": " + a + b);

    : 53 8
    (a + b)


    3: if

    :
    ? 10 “”

    ? :

    • = ==
    • { }

    ?:

    int x = 15;
    if(x = 10){
    System.out.println("");
    }

    : == =


    4:

    :

    ? :

    • import Scanner
    • object

    ?:

    Scanner sc;
    int x = sc.nextInt();

    : new Scanner(System.in)


    5: while

    :
    1 3 while

    ? :

    • i++ loop

    ?:

    int i = 1;
    while(i <= 3){
    System.out.println(i);
    }

    : i


    ? ? :

    • ;
    • = ==
    • { }
    • loops increment
  • Java Question

    Create a new Java project and implement the following classes based on the following class

    diagrams and description:

    1. 2. Create the classes based on the below UML diagram.

    Create a Test class, then instantiate the following objects:

    a. Three objects of type Person.

    b. Two objects of type Faculty.

    c. Three objects of type Student.

    d. Two objects of type Alumni.

    3. 4. 5. 6. Add all objects to an array of objects of type Person.

    Create a void method display that print the details of the elements of the array.

    Print the details of all the persons using the method in 4.

    Using the static attributes (class reference variables) create a method that prints the number of

    objects of:

  • Person.
  • Faculty.
  • Student (all students).
  • Alumni.
  • Student (but not Alumni).
  • Please check the attached file and submit your code. Do not submit screenshots or links.
  • ER Diagram for University Database with Entities, Relationsh…

    I need help designing an ER diagram for a University Database system. The system should include entities such as Student, Course, Instructor, Department, Club, and Activity along with their attributes.

    Each student has details like student ID, name, address, gender, birth date, degree, and department. Students can enroll in multiple courses, and each course records grades. Courses include attributes like course code, name, description, department, points, instructors, and exam date.

    Instructors have attributes such as IRD number, name, address, phone numbers, gender, salary, and position. Each instructor works in one department, and each department has one manager (instructor) and multiple instructors.

    Students can join multiple clubs. Clubs have attributes like name, budget, meeting day, and time, and must have members. Clubs also sponsor activities. Each activity has attributes like ID, type, date, time, and location, and is sponsored by one club.

    The ER diagram should clearly show:

    Entities and attributes (with primary keys underlined)

    Relationships using diamonds

    Cardinalities (1:1, 1:N, M:N)

    Participation (total/partial using single/double lines)

    I also need a properly structured explanation along with the diagram.

  • What is the difference between == and .equals() in Java?

    Here is the straightforward breakdown of the difference between the two:

    The == Operator (Reference Comparison)

    • What it does: For objects, it checks if two variables point to the exact same object in memory (the same memory address).
    • For Primitives: If you are comparing primitive data types (like int, double, or boolean), == simply compares their actual numerical or boolean values.

    The .equals() Method (Value Comparison)

    • What it does: It evaluates the actual content inside the objects to see if they are logically identical.
    • How it works: Classes like String and Integer are specifically programmed to check the data inside them when .equals() is called. If you create your own custom class, you have to write (override) the .equals() method yourself to tell Java exactly what makes two of your objects “equal.”

    Quick Code Example

    Java

    String str1 = new String("java");String str2 = new String("java");String str3 = str1;// Using ==System.out.println(str1 == str2); // FALSE: They contain the same text, but are two completely separate objects in memory.System.out.println(str1 == str3); // TRUE: They point to the exact same memory location.// Using .equals()System.out.println(str1.equals(str2)); // TRUE: Their actual text content ("java") is exactly the same.
  • Java Question

    Library Management System

    You are required to design a simple system for managing a library. Each library contains multiple

    books, and each book has its own information. Implement the following classes as described below.

    Please check the attached file and submit your code. Do not submit screenshots or links.

  • Implementation of a Singly Linked List with Reversal and Cyc…

    Please provide a complete Java implementation of a Singly Linked List that includes the following functionality:

    1. Basic Operations: Methods to insertAtEnd, deleteByKey, and displayList.
    2. Algorithm 1 (Reversal): An efficient iterative method to reverse the linked list in place ( time complexity, space).
    3. Algorithm 2 (Cycle Detection): Implement Floyds Cycle-Finding Algorithm (Hare and Tortoise) to detect if the list contains a loop.

    Requirements:

    • Language: Java (JDK 17 or higher).
    • Structure: Use a separate Node class and a LinkedList class.
    • Documentation: Please include comments explaining the logic for the reversal and cycle detection parts.
    • Testing: Provide a main method that demonstrates these features working correctly.”
  • Java Question

    Inheritance in Java is when a class (child) acquires the properties and methods of another class (parent), allowing code reuse.

    Polymorphism is the ability of a method or object to take many forms, such as method overriding (same method, different behavior) or method overloading (same name, different parameters).