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 5842249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:59:35+00:00 2026-05-22T11:59:35+00:00

Foo Public Class Foo Private fooz As Object Private alao As ArrayList Public Sub

  • 0

Foo

Public Class Foo
    Private fooz As Object
    Private alao As ArrayList

    Public Sub New(ByVal pfooz)
        Me.fooz = New Object
        Me.alao = New ArrayList()

        Me.alao.Add(1)
        Me.alao.Add(2)
        Me.alao.Add(3)
        Me.alao.Add(4)
        Me.alao.Add(5)
    End Sub
End Class

Bar

Public Class Bar
    Private baz As Integer
    Private bar As String
    Private foo As Foo

    Public Sub New(ByVal pbaz, ByVal pbar, ByVal pfoo)
        Me.baz = pbaz
        Me.bar = pbar
        Me.foo = pfoo
    End Sub
End Class

My Form

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim foo As Foo = New Foo(New Object)
        Dim bar As Bar = New Bar(1, "FOOOOOOOOOOOOO, bar?", foo)
        Dim fooString As String
        Dim barString As String

        fooString = Newtonsoft.Json.JsonConvert.SerializeObject(foo)
        barString = Newtonsoft.Json.JsonConvert.SerializeObject(bar)

        MsgBox(fooString)
        MsgBox(barString)
    End Sub
End Class

I always get {} as answer. What’s wrong?

  • 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-22T11:59:36+00:00Added an answer on May 22, 2026 at 11:59 am

    Neither of these classes have any Public properties or fields. If you want to represent your fields as values that should be present in a JSON string, make them public. Otherwise, as far as the serializer is concerned, you’re giving it objects with no interesting values on them.

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

Sidebar

Related Questions

The class class A private def foo puts :foo end public def bar puts
As an example: public class Foo { private Foo() {} } public class Bar
What is the difference between this: public class Foo { private Bar bar; public
This is my Java 1.6 class: public class Foo { private ArrayList<String> names; public
If I have the following code: public class Foo { private Object obj =
Assuming the following class stub: public class Foo<T> { private Class<T> type; public Foo<T>
I have a class like this public class foo { private void getThread() {
I'm used to writing classes like this: public class foo { private string mBar
I have a class class foo { public: foo(); foo( int ); private: static
I have a class: class foo { private: std::string data; public: foo &append(const char*

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.