问候,我正在尝试为我的一个列表创建一个分页面板,并希望将其置于中心位置.目前它看起来像:
<div class="panel">
<div class="page">1</div>
<div class="page">2</div>
<div class="page">3</div>
</div>
Run Code Online (Sandbox Code Playgroud)
所以我基本上试图让所有"page"div元素转到"panel"容器的中心,如下所示:
_____________________________
| 1 2 3 |
------------------------------
Run Code Online (Sandbox Code Playgroud)
有没有办法在不知道 "页面"元素需要的宽度的情况下实现它(可能有3或9页,并且两种情况都应该正确处理).
提前致谢.
public class Double1 {
public static double parseDouble(String _s, double _def) {
try {
return Double.parseDouble(_s);
}
catch(Exception e) {
}
return _def;
}
public static void main(String[] args) {
Double1 db=new Double1();
boolean ab=db.parseDouble("vijay", Double.NaN)!=Double.NaN?true:false;
System.out.println("ab value: "+ ab);
System.out.println(Double.NaN==Double.NaN);
}
}
Run Code Online (Sandbox Code Playgroud)
它应该返回true上面代码返回的位置false.为什么?
我真的很难过.我正在为我的老师编写一个程序(我使用Python 3 btw),这样他就可以将这些代码交给学生来计算他们的成绩而不是等待他们的成绩单.我只是一个初学者所以请尽量保持答案:D
好的,这是问题所在.我拥有代码所需的所有输入.输入就像这样工作.A = 5 B = 4 C = 3 D = 2 E = 1.如果你得到直的A,你会获得50分,依此类推,但如果结果是35分,那么所有等级计算器都会崩溃.因为如果它的> 30是一个B,但是如果它> 20则是一个C,但是> 20和> 30同时打印.因为如果结果大于30,它们都会执行.我不知道怎么做它会打印说"B"如果它是31到40.
这是代码
a = eval(input())
b = eval(input())
c = eval(input())
d = eval(input())
e = eval(input())
f = eval(input())
g = eval(input())
h = eval(input())
i = eval(input())
j = eval(input())
average = a + b + c + d + e + f + g + h + i + j
print(average)
if average >41:
print(" Grade …Run Code Online (Sandbox Code Playgroud) 我有3个班,第一个是人:
public class Person {
Person() {
}
}
Run Code Online (Sandbox Code Playgroud)
其次是工程师,延伸人
public class Engineer extends Person {
Engineer() {
}
}
Run Code Online (Sandbox Code Playgroud)
和另一个人的延伸
public class Doctor extends Person {
Doctor() {
}
}
Run Code Online (Sandbox Code Playgroud)
最后一个是将构造函数作为对象Person的工作
public class Work {
Work(Person p) {
//how to insure that p is Engineer ?
}
}
Run Code Online (Sandbox Code Playgroud)
如何检测对象p是Engeneer而不是来自另一个类?
我只有13岁,Java很难理解.我需要更改屏幕左上角的图标,但我无法弄明白.我已经看过很多论坛主题,但是不了解它或者把方法放在哪里!请帮忙!
这是我的代码:
import javax.swing.JFrame;
public class Frame extends JFrame
{
public Frame()
{
//options for the frame
setTitle("Builder");
setSize(1000, 650);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setResizable(true);
}
//shortcut setting
public static void main(String[] args)
{
Frame f = new Frame();
}
}
Run Code Online (Sandbox Code Playgroud) 我想传递类之间的String值都是相同的包.所以我创建了类似代码的类:
public class Map_Delegate {
String myLatitude;
String myLongitude;
String myName;
private String TAG = "Map_Delegate";
public String getMyName() {
return this.myName;
}
public void setMyName(String value) {
Log.v(TAG, value);
this.myName = value;
}
public String getMyLatitude() {
return this.myLatitude;
}
public void setMyLatitude(String value) {
Log.v(TAG, value);
this.myLatitude = value;
}
public String getMyLongitude() {
return this.myLongitude;
}
public void setMyLongitude(String value) {
Log.v(TAG, value);
this.myLongitude = value;
}
}
Run Code Online (Sandbox Code Playgroud)
但它无法传递价值.我做了这样的代码来设置值:
Map_Delegate map = new Map_Delegate();
map.setMyName(first_name_temp + " …Run Code Online (Sandbox Code Playgroud) file.delete()函数false在正确删除文件时返回大文件.
import java.io.File
public class Delete {
File file = new File(file path, filename);
boolean deleted == file.delete();
if(deleted == true) {
some code for delete related title
}
}
Run Code Online (Sandbox Code Playgroud)
在这个代码file.delete()函数返回false一些文件,但我不知道原因.但是,当我在Android设备的本地内存中手动检查时,该文件实际上已被删除.任何人都可以解释这种行为的原因吗?