首页 \ 问答 \ Arraylist,if else语句(Arraylist, with if else statements)

Arraylist,if else语句(Arraylist, with if else statements)

我有一个相当简单的java编程问题

我目前正在java中进行早期作业。

我需要制作一个Assistans的Arraylist(int salary,String name)

棘手的部分是,我需要制作一个方法,说明如果他们的工资相等或超过150,你只能添加助手。

无论我们有多少助手,我们都希望这种方法有效。

总结一下,

如果助理工资高于或等于150,我们希望他们加入,

否则我们不希望他们添加到arraylist

任何帮助深表感谢 :)

提前致谢


I have a rather simple java programming question

i am currently working on an early stage assignment in java.

I need to make an Arraylist of Assistans (int salary, String name)

the tricky part, is that i need to make a method that states that you can only add the assistants if their salary is equal too or more than 150.

we want the method to work, no matter how many assistants we have.

so to sum up,

if the assistants salary is higher or equal to 150 we want them added,

else we dont want them added to the arraylist

any help is much appreciated :)

thanks in advance


原文:https://stackoverflow.com/questions/15884071
更新时间:2024-01-06 14:01

最满意答案

在我的示例中,PFBC将创建:1。包含标签和输入类型的元素,其中id ='#element_bank_name'2。输入类型将具有id ='bank_name'

因此,要隐藏您执行的整个元素:

$('#element_bank_name').slideUp();

要更改输入元素值,请执行以下操作:

$('#bank_name').val("");

In my example, PFBC will create: 1. an element that contains both the label and the input type with id='#element_bank_name' 2. the input type will have id='bank_name'

So, to hide the entire element you do:

$('#element_bank_name').slideUp();

And to change the input element value you do:

$('#bank_name').val("");

相关问答

更多
  • 您可以使用selected的选项inherit_select_classes 。 在select元素上给出必需的类,并为此选择器设置css .required> selected-single $(".pnChosen").chosen({ search_contains: true, inherit_select_classes: true });