CdRecord [] records = null; : This is an array that takes CdRecord objects. THE ARRAY IS NULL

CdRecord [] records = new CdRecord[2]; : This array IS NOT NULL. The records IS an array and it behaves EXACTLY like any other array. But records[0] and records[1] ARE CdRecord objects and they are NULL.

Since you don't know how many CDs the user will enter then don't use an array. With arrays you NEED to know from the beginning their size. Use Vectors or ArrayLists.

I would suggest to alter the printCdRecord(). Every class inherits the toString() method from Object. It returns as a String all the information of the current instant of your class. So it would be better for you to do the same. Actually even if no one is forcing to do this (programmatically speaking) it is most preferable to have a toString() than a print method:
Your Code:

And call the above method in your main:
System.out.println(one.toString()); or better: System.out.println(one);

When you put an instant of a class in a System.out.println it will automatically call the toString() method. If you haven't implemented one it will the super class toString() and so on until it reaches the Object.toString().

Sorry for posting too many times but I think it is better to have different suggestions separated:

I need to create a menu of options as well, which include:
* new entry from keyboard
*print entries so far
*quit

A)Put your code inside a while(true) loop
B)Read from the keyboard the input:
String input=JOptionPane.showInputDialog("");
--If you give "read new entry" do whatever you are already doing but instead of printing it, put it inside a Vector"
--If you give "print" use a for-loop to print the entries
--If you give "quit" then use the command break; to exit the while(true) loop

Since you don't know how many CDs the user will enter then don't use an array. With arrays you NEED to know from the beginning their size. Use Vectors or ArrayLists.

I would suggest to alter the printCdRecord(). Every class inherits the toString() method from Object. It returns as a String all the information of the current instant of your class. So it would be better for you to do the same. Actually even if no one is forcing to do this (programmatically speaking) it is most preferable to have a toString() than a print method:
Your Code:

And call the above method in your main:
System.out.println(one.toString()); or better: System.out.println(one);

When you put an instant of a class in a System.out.println it will automatically call the toString() method. If you haven't implemented one it will the super class toString() and so on until it reaches the Object.toString().

I incorporated this into my program but when the user enters the artist, album, and track no, it doesn’t print, it prints
Artist Name: A
Album Name: B
No. Of Tracks: 0
Artist Name: A
Album Name: B
No. Of Tracks: 0

here's my code
import javax.swing.JOptionPane;

class Cd
{
public static void main (String[] args)
{
int menu_choice;

CdRecord one = new CdRecord();
System.out.println(one.toString());

one.artist_name = JOptionPane.showInputDialog("Enter artist name.");
one.album_name = JOptionPane.showInputDialog("Enter album name.");one.no_of_tracks =Integer.parseInt(JOptionPane.showInputDialog("Enter the number of tracks on the album"));

CdRecord one = new CdRecord();
System.out.println(one.toString());
one.artist_name = JOptionPane.showInputDialog("Enter artist name.");
one.album_name = JOptionPane.showInputDialog("Enter album name.");
one.no_of_tracks =Integer.parseInt(JOptionPane.showInputDialog("Enter the number of tracks on the album"));

When you create the object:
CdRecord one = new CdRecord();
it has values: "A", "B", 0.
Then you call: System.out.println(one.toString()); So it prints the values that it currently has.
You give values to the object afterwards and you don't print them. So place the System.out.println() after you have given values to the object:

CdRecord one = new CdRecord();
one.artist_name = JOptionPane.showInputDialog("Enter artist name.");
one.album_name = JOptionPane.showInputDialog("Enter album name.");
one.no_of_tracks =Integer.parseInt(JOptionPane.showInputDialog("Enter the number of tracks on the album"));
System.out.println(one.toString());

First of all how do you know that you will have exactly 3 objects. If this is the case then use arrays:
CDRecord [] records=new CDRecord[3]; And follow the example I sent you.
With arrays you cannot add more objects than the size of the array.

If you have a while-loop and the user can give as many CDRecord as he wants then use ArrayList: /java/util/ArrayList

The above is an object.
And I have seen your other post. I would suggest not to open a new post for the same thing. And most important do not have different versions of code in different posts.
Use the code you have at this post. Forget about the other. Add in this code the part where you create the menu with the if-statements but don't put anything inside them. Then start all over.
Put code in one of these options test it and then try to code the others. I saw that you tried to fix all the menu options and there are many different bugs. Try to build one by one.

When you use code tags inside the [] write next to the code=JAVA so I can see the lines or write in the code where the error was, because I can't count your entire code to find the line that the error happened

takes an array as an argument. So you should call it with an array, not like this:
result=CdSearch(CdRecord,searchKey,counter);
CdRecord is not an array and you don't declare it anywhere. That is why you get the error.
Call trhe method like this:
result=CdSearch(arrayrecord,searchKey,counter);

And you shouldn't use the toString() for comparisons. It is only for returning the values of the object. In order for the above to work the searchKey should have exactly the structure that the toString returns. Based on what you want to compare them, meaning what attribute of the class you want to use in order to distinguish one instance from the other? If name is what you want then ask for the name from the dialog box and do this in the method:

data[counter].name.equals(searchKey) or if you have a getName:
data[counter].getName().equals(searchKey)

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...