⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 5-8.txt

📁 jsp常用实例讲解
💻 TXT
字号:
class doRect
{
public static void main(String args[])
{
int w=Integer.valueOf(args[0]).intValue();
int h=Integer.valueOf(args[1]).intValue();
Rectangle myrect=new Rectangle(w,h);
myrect.drawRect();
}
class Rectangle
{
int width,height,area;
public Rectangle(int w,int h)
{
width=w;
height=h;
area=getArea(w,h);
}
protected int getArea(int w,int h)
{
int a;
a=w*h;
return a;
}
public void drawRect()
{
int i,j;
for(i=width;i>0;i--)
System.out.print("#");
System.out.print("")
for(i=height-2;i>0;i--)
{
System.out.print("#");
for(j=width-2;i>0;j--)
System.out.print("");
System.out.print("#");
}
for(i=width;i>0;i--)
System.out.print("#");
System.out.print("");
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -