\documentclass{article}
\begin{document}

\section{Sec}

\subsection{Ssec}

\paragraph{Par}

\section*{Sec}

\subsection*{Ssec}

\paragraph*{Par}

%\section{Sec}

\subsection{Ssec}

\paragraph{Par}

\section*{Sec2}

\subsection*{Ssec2}

\end{document}
