Question: I want to make it so that each Time it goes through the for loop, it places the value on the same line, but I don't know how. Can someone help?

Edit: i'm trying to set up an address book type code, for an assignment, and i want to display the output so all J outputs are on the same line of of the listbox. 

Here is the code which will declare what each number of J is:

```
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    i += 1
    j = 0
    AddressArray(i, j) = TxtFirstName.Text   
    j += 1

    AddressArray(i, j) = TxtLastName.Text 

    j += 1

    If TxtHomePhone.Text = "" Then              
        AddressArray(i, j) = "N/A"
        j += 1
    Else
        AddressArray(i, j) = TxtHomePhone.Text
        j += 1
    End If
    If TxtMobilePhone.Text = "" Then           
        AddressArray(i, j) = "N/A"
        j += 1
    Else
        AddressArray(i, j) = TxtMobilePhone.Text
        j += 1
    End If
    AddressArray(i, j) = TxtHomeNumb.Text       
    j += 1
    AddressArray(i, j) = TxtStName.Text         
    j += 1

    AddressArray(i, j) = TxtSuburb.Text    

    For j = 0 To 6
        LstAddresses.Items.Add(AddressArray(i, j))

    Next
End Sub      

```

The for loop is to print it out and i'll give a picture of the output on the form to give what i want and what is given: (i've read from a file using streamreader as input for the listbox as the test data)

[The form of the application](https://i.stack.imgur.com/HgWOy.png)

Answer: 
The error is because you must have both libraries (`org.apache.spark.sql.execution.datasources.csv.CSVFileFormat` and `com.databricks.spark.csv.DefaultSource`) in your classpath. And spark got confused which one to choose.

All you need is tell spark to use `com.databricks.spark.csv.DefaultSource` by defining `format` option as 

```
  df = session \
       .read \
       .format("com.databricks.spark.csv") \
       .option("inferSchema", value = True) \
       .option('header','true') \
       .csv("/home/senthiljdpm/RealEstate.csv")

```

Another alternative is to use `load` as 

```
  df = session \
       .read \
       .format("com.databricks.spark.csv") \
       .option("inferSchema", value = True) \
       .option('header','true') \
       .load("/home/senthiljdpm/RealEstate.csv")

```
If anyone faced a similar issue in Spark Java, it could be because you have multiple versions of the spark-sql jar in your classpath. Just FYI.