Why can i not import sun packages in java?

import sun.audio.AudioPlayer.;
//import the sun.audio package
import java.io.
public class Main {
Random rand = new Random();
//** add this into your application code as appropriate
// Open an input stream to the audio file.
InputStream in = new FileInputStream(Filename);
// Create an AudioStream object from the input stream.
AudioStream as = new AudioStream(in);

It says sun.audio cannot import. Is it because it isn’t allowed, or have I done some stupid mistake?

Welcome to the community!

1 Like