Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6090355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:12:17+00:00 2026-05-23T12:12:17+00:00

I have a class as follows: Public Class Courses Public CoursesOfferedMAIN As New List(Of

  • 0

I have a class as follows:

Public Class Courses
    Public CoursesOfferedMAIN As New List(Of Category)
    Public CoursesList As New List(Of Course)
    Public SemsList As New List(Of Sem)
    Public SubjectsList As New List(Of Subjects)
    Public ExamsTypeList As New List(Of ExamType)

    Public Class Category
        Private CategoryName As String
        Private Deleted As Boolean
        Public Courses As New List(Of Course)
    End Class
    Public Class Course
        Private CategoryName As String
        Private CourseID As String
        Private CourseName As String
        Private Deleted As Boolean
        Public Sems As New List(Of Sem)

    End Class
    Public Class Sem
        Private CategoryName As String
        Private CourseID As String
        Private SemID As String
        Private SemName As String
        Private Deleted As Boolean
        Public Subjects As New List(Of Subjects)
    End Class
    Public Class Subjects
        Private CategoryName As String
        Private CourseID As String
        Private SemID As String
        Private SubjectID As String
        Private SubjectName As String
        Private Deleted As Boolean
        Public Exams As New List(Of ExamType)
    End Class
    Public Class ExamType
        Private CategoryName As String
        Private CourseID As String
        Private SemID As String
        Private SubjectID As String
        Private ExamTypeID As String
        Private ExamName As String
        Private ExamMax As String
        Private ExamMin As String
        Private ExamPass As String
        Private Deleted As Boolean
    End Class

    Public Sub UpdateLists()
        CoursesList.Clear()
        SemsList.Clear()
        SubjectsList.Clear()
        ExamsTypeList.Clear()
        For Each Cat As Category In CoursesOfferedMAIN
            For Each cour As Course In Cat.Courses
                CoursesList.Add(cour)
                For Each sems As Sem In cour.Sems
                    SemsList.Add(sems)
                    For Each subj As Subjects In sems.Subjects
                        SubjectsList.Add(subj)
                        For Each exam As ExamType In subj.Exams
                            ExamsTypeList.Add(exam)
                        Next
                    Next
                Next
            Next
        Next
    End Sub
End Class

There is no problem with the code how ever, I would like to know, in the process I am following, the number of subjects, couses, examsets etc would all get repeated in the specific type lists like SubjectsList, examstypelist etc.. since they are being copied over it would take more memory.

Hence, my question or doubt would be, is it possible to use the same as references instead of copying them over to lists to save memory, or are there any methods better than this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:12:17+00:00Added an answer on May 23, 2026 at 12:12 pm

    You are already using references. Classes are reference types, so when you copy the objects you are actually just copying the references to the objects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

New to FluentNHibernate =D I have a parent/children classes as follows: public class Parent
I have a class as follows: public class Document { public List<DocumentSection> sections =
So I have a class with a method as follows: public class SomeClass {
if we have 2 class Zoo & Moo as follows: public class zoo {
I have a class A as follows: class A { public: A() { printf(A
I have a class SimpleCircle. Its declaration is as follows: class SimpleCircle { public:
I have two classes Address and Employee as follows: public class Address { public
I have a Java class, Node as follows : class Node { public ArrayList<Node>
I currently have a page which is declared as follows: public partial class MyPage
I have a Point2D class as follows: class Point2D{ int x; int y; public:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.