有没有任何好的+免费+轻量级+ Linux UML设计工具?(Are there any good + free + Lightweight+ Linux UML Design tools? [closed])
我正在寻找一个UML设计工具(仅用于设计,不需要代码生成)。
主要特征
- 自由
- 对于Linux
- 使用方便
- 轻量级
I am looking for a UML design tool (just for design, no need for code generation).
Key features
- Free
- For Linux
- Easy to use
- Lightweight
原文:https://stackoverflow.com/questions/9207092
最满意答案
我确信你的缓冲区中有一个额外的未消耗的新行字符。 通过在
else-if
之后在while循环的末尾添加一行来消费它else if(searchagain=='y') { runnable=true; } br.nextLine();
键入第一个输入后按Enter键,
Scanner.nextLine()
此扫描器超过当前行并返回跳过的输入。 此方法返回当前行的其余部分,不包括末尾的任何行分隔符。 因此,行分隔符\n
仍然在缓冲区中,这是在第二次迭代循环时消耗的。我们需要通过调用br.nextLine();
来有目的地使用它br.nextLine();
在while循环结束时,将新行字符\n
留在空中,然后进行第二次循环以获得新输入。 这将使其停止并第二次获得输入。让我以简单的方式解释你。 你的程序要求
输入您希望搜索的图书
现在,您给出
Effective Java
并按Enter键。 这会变成EffectiveJava \ n
输入结尾的
\n
(未消耗的char)将不会被br.nextLine()
。 因此,我们需要在while循环结束时明确地删除它。 所以,在第二个循环期间,\n
将不会被br.nextLine()
,它将要求您输入I am sure that you have an extra unconsumed new line character in your buffer. Consume it by adding a line at the end of the while loop after
else-if
else if(searchagain=='y') { runnable=true; } br.nextLine();
When you hit enter after keying the first input,
Scanner.nextLine()
advances this scanner past the current line and returns the input that was skipped. This method returns the rest of the current line, excluding any line separator at the end. so, the line seperator\n
is still in the buffer, which is been consumed while iterating the loop for the second time.we need to consume it purposefully by invokingbr.nextLine();
at the end of the while loop and leave the new line character\n
in air and go for second loop for fresh input. This will make it to stop and get the input for the second time.Let me explain you in a simple way. Your program asks for
Input Books you wish for search
Now, you give
Effective Java
and press enter. This would becomeEffectiveJava\n
\n
(unconsumed char) in the end of your input will not be consumed bybr.nextLine()
. So, we need to explicitly get rid of it at the end of while loop. so, that\n
will not be consumed by thebr.nextLine()
during the second loop and it will ask for your input
相关问答
更多-
我确信你的缓冲区中有一个额外的未消耗的新行字符。 通过在else-if之后在while循环的末尾添加一行来消费它 else if(searchagain=='y') { runnable=true; } br.nextLine(); 键入第一个输入后按Enter键, Scanner.nextLine()此扫描器超过当前行并返回跳过的输入。 此方法返回当前行的其余部分,不包括末尾的任何行分隔符。 因此,行分隔符\n仍然在缓冲区中,这 ...
-
对于循环变量从1开始,而不是0和jQuery的问题(For loop variable starts at 1 instead of 0 and jquery problems)[2023-12-12]
你的问题是,你正在按类访问你的container div,所以每次你添加一个问题时,你都将它添加到新的div以及所有先前的div中。 循环行为的例子。 After 1st loop div.container Q1 After 2nd loop div.container Q1 Q2 div.container Q2 and keep going 解: var questions = ['Dog on plane', 'cat in train', 'the tu ... -
我不确定你想要实现什么,但是你可以在下面的代码中进行一些修改。 public static void main(String[] args) { Scanner kb = new Scanner(System.in); String[]namearray; //Setting up the arrays namearray = new String[1000]; //Assume there are not 1000 ...
-
当你跑步 do{ System.out.println ("Error: Enter a number"); }while (!input.hasNextDouble()); input.hasNextDouble()检查命令行是否有double等待。 如果您改为使用input.next()获取一个字符串并每次检查它是否为dobule,程序将适当地等待。 你可以这样做 double double1=-1; while (double1!=-1){ String number=inp ...
-
在你的一个Integer.parseInt(); 在chooseClass方法中你输入一个空字符串(你直接按Enter键)。 要避免它,如果你想将“”解释为0,请使用: int num = 0; try { num = Integer.parseInt(); } catch (NumberFormatException e) { } 这样,如果发生错误,num variable的值将为0。 In one of your Integer.parseInt(); inside chooseClass ...
-
添加条件: lottoNum = lottoNum + num; if (i < 6) lottoNum = lottoNum + ", "; 它会在除最后一个数字之外的每个数字的末尾添加。 Add condition: lottoNum = lottoNum + num; if (i < 6) lottoNum = lottoNum + ", "; It will add , at end of each number except the last number.
-
您需要为每个内部循环重复外部循环。 You need to repeat the outer loop for each inner one.
-
虽然循环没有要求输入(While loop did not ask for input)[2022-10-11]
你有: cout << "You have selected odd \n are you sure?\n 1.Yes 2.NO \n Insert :"; cin >> Conformation; 由于Confirmation属于bool类型,因此使用1或2进行Confirmation很可能会使您bool 。 我建议将Confirmation类型更改为int 。 You have: cout << "You have selected odd \n are you sure?\n 1.Yes 2.NO ... -
这个问题是由于前一个scanf留下的\n字符。 在scanf每个%c说明符前放置一个空格来吃掉\n 。 。 scanf(" %c", &introducido); ... scanf(" %c",&continuar); This problem is because of \n character left behind by the previous scanf. Place a space before each %c specifier in scanf to eat up \n. . s ...
-
在for循环中计算输入文件(Count input files in for loop)[2023-06-01]
使用闭包修改IIFE function showDetails(file, content, n) { var start = content.substring(0, 9); var message = "File " + n + " is " + file.name + " and starts with " + start + " .
"; $('#results').append(message); } $(document).ready(function() { $('#f ...