we can start jshell session in command-prompt by simply typing jshell. we can use different commands: /exit to quit the jshell session, reset/reload jshell anytime by typing /reset, and /reload, /import to list the imports, etc.
in the below example, we can print the stars in jshell by using the for loop.
c:\users\user>jshell| welcome to jshell -- version 9.0.4| for an introduction type: /help introjshell> for(int i=0; i<10; i++) {...> for(int j=0; j<=i; j++)...> system.out.print("*");...> system.out.println("");...> }*******************************************************
以上就是如何在java 9的jshell中打印星星的图案?的详细内容。