小编unk*_*ror的帖子

super.paint(g)的用途是什么?

有人可以解释我在super.paint(g)哪里使用,gGraphics Applets或awt或swing或Java中的变量.

我做过研究,发现它用于覆盖但是这个覆盖的用途是什么?

我是初学者.如果可能的话,你可以解释之间的差异paint(g),并super.paint(g)用小example或请帮助我的代码?

/*
Let us consider this code 
This has only one paint declaration i.e; subclass's paint method declaration, no     declaration for superclass's paint function... when we explicitly call superclass's paint function 
what is the use of super.paint(g) and is it going to use superclass's paint declaration??
*/

import java.awt.*;
import java.applet.*;
/*
<applet code="superpaintDemo" height=768 width=1366>
</applet>
*/
class superpaintDemo extends Applet
{

    public void paint(Graphics …
Run Code Online (Sandbox Code Playgroud)

java applet awt paint super

9
推荐指数
1
解决办法
1万
查看次数

使用 intellij 在不同分支上工作时显示 git diff 与 origin master 的快捷方式

我倾向于每天多次检查git diff with origin master使用情况,这对我来说已成为一项任务。intellijlaborious

我使用 intellij 提供的 git diff 工具...如下建议:https ://stackoverflow.com/a/49642681/2960555

有没有办法add shortcut执行此手动步骤。

git diff intellij-idea

9
推荐指数
1
解决办法
4119
查看次数

计划编程语言中的递增和递减运算符

编程语言中有哪些incrementdecrement运算符scheme.我使用的是"Dr.Racket",它不接受-1+1+作为运营商.而且,我也尝试过incfdecf,但没有用.

scheme increment operators decrement racket

6
推荐指数
2
解决办法
6802
查看次数

为什么Long无法接受12位数值,即使我明确宣布它?

import java.io.*;
import java.util.*;
public class Solution
{
    public static void main(String args[])
    {
            Scanner s=new Scanner(System.in);

            int k=s.nextInt();
            long  value=0L;

            value=(k-(k/2)) * (k/2);

            System.out.println(value);

    }
}
Run Code Online (Sandbox Code Playgroud)

现在,我输入的输入为1856378k,
预期输出为861534819721
但是我得到了-1753606775

为什么在价值长的时候给出错误答案

java

4
推荐指数
2
解决办法
101
查看次数

标签 统计

java ×2

applet ×1

awt ×1

decrement ×1

diff ×1

git ×1

increment ×1

intellij-idea ×1

operators ×1

paint ×1

racket ×1

scheme ×1

super ×1