我有一个名为classes的包,其中包括x.java和y.java.x.java:
public class x{
private int a;
private int b;
private String c;
private String d;
private String e;
private String f;
//And the fields are encapsulated.
}
Run Code Online (Sandbox Code Playgroud)
y.java:
public class y{
private List<x> xs;
private int k1;
private int k2;
private String k3;
private String k4;
//And the fields are encapsulated.
}
Run Code Online (Sandbox Code Playgroud)
z.JSP:
<%
usecase y = new y();
request.getSession().setAttribute("yy", y);
%>
<form action="aaa?id=1" method="POST">
<td>
<input type="text" name="bbb"/>
</td>
<td>
<input type="text" name="ccc"/>
</td>
<td>
<input type="submit" name="ddd"/> …Run Code Online (Sandbox Code Playgroud) 在C++语言中,声明变量全局是否有任何缺点?
void foo()
{
int a;
a=10;
}
int a;
void foo()
{
a=10;
}
Run Code Online (Sandbox Code Playgroud)
他们之间有什么不同?