首页 \ 问答 \ 用Java加载类(Loading of a class in Java)

用Java加载类(Loading of a class in Java)

在java中编译源代码时,会加载类。 加载一个类意味着什么?

对一些学习材料的详细解释或链接将非常有帮助。


In java when we compile a source code, the classes are loaded. What does loading of a class mean ?

An elaborate explanation or link to some study material will be very helpful.


原文:https://stackoverflow.com/questions/4401002
更新时间:2022-05-06 14:05

最满意答案

一个别名不能接受参数,所以你需要创建一个函数:

acp ()
{
        git add -A;git commit -m "$1";git push
}

一如既往,将其存储在~/.bashrc ,并使用source ~/.bashrc

或者更好的( 好提示,binfalse )避免执行一个命令,如果以前不成功,在它们之间加上&&

acp ()
{
        git add -A && git commit -m "$1" && git push
}

执行它

acp "your comment"

使用双引号是很重要的,否则它只会得到第一个参数。


An alias cannot accept parameters, so you need to create a function:

acp ()
{
        git add -A;git commit -m "$1";git push
}

as always, store it in ~/.bashrc and source it with source ~/.bashrc.

Or better (good hint, binfalse) to avoid performing a command if the previous was not successful, add && in between them:

acp ()
{
        git add -A && git commit -m "$1" && git push
}

Execute it with

acp "your comment"

It is important that you use double quotes, otherwise it will just get the 1st parameter.

相关问答

更多
  • 正确的方法是获取脚本,而不是运行脚本。 source myscript.sh mycmd The proper way to do is to source the script rather than running it. source myscript.sh mycmd
  • 如何使用函数? 将其添加到.bashrc: function searchFiles() { find . -name \*."$1" -print0 | xargs -0 grep --color -n "$2" } 然后像这样使用它: $ searchFiles c include How about using a function? Add this to your .bashrc: function searchFiles() { find . -name \*."$ ...
  • 根据以下环境变量名称只能包含 大写字母,数字和便携式字符集中定义的字符的'_'(下划线),并且不以数字开头。 其他角色可能会被执行所允许; 应用程序应该容忍这些名称的存在。 但变量与别名不同。 在实践中, - (短划线)应该被添加到列表中,因为它是debian( apt-get )中的事实标准。 另外_~!@#$%^.,[]+/? 所有的工作和><'"|=()backtick 。不要。另外你必须担心$PATH和像下面这样的字符: 。看起来空间和换行符可以工作,如果它们被正确地转义或引用像"ab" 。 Acc ...
  • 我不认为你可以这样使用别名。 但是,您可以声明一个函数: function t { cd "$1" ls -la } I don't think you can use aliases that way. You can, however, declare a function: function t { cd "$1" ls -la }
  • 创建别名: alias e=execute 作为一个例子,我有别名的l 。 我仍然可以输入l -l ,它按预期工作。 任何args都会通过。 Make your alias: alias e=execute As an example, I have ls aliased to l. I can still type l -l and it works as expected. Any args just get passed through.
  • 一个别名不能接受参数,所以你需要创建一个函数: acp () { git add -A;git commit -m "$1";git push } 一如既往,将其存储在~/.bashrc ,并使用source ~/.bashrc 。 或者更好的( 好提示,binfalse )避免执行一个命令,如果以前不成功,在它们之间加上&& : acp () { git add -A && git commit -m "$1" && git push } 执行它 acp "your c ...
  • 尝试这个: #!/bin/bash permalias() { local alias_regex='[A-Za-z_0-9]*' if [[ $# = 1 && $1 =~ ($alias_regex)=(.*) ]] then printf "%s\n" "${BASH_REMATCH[1]}=\"${BASH_REMATCH[2]}\"" >> ~/.bashrc else echo "USAGE: permalias VARNAME=ALIAS_COMMAND ...
  • 您需要在等号后删除空格。 You need to remove the space after the equal sign.
  • 您可能还想使用Bash的$_内部变量 ,而不是摆弄Bash的历史:手册的相关部分说明: $_ :[...]扩展后扩展到上一个命令的最后一个参数。 [...] 例如: $ touch one two three $ echo "$_" three $ ls $ echo "$_" ls $ a='hello world' $ echo $a hello world $ echo "$_" world $ echo "$a" hello world $ echo "$_" hello world $ 在您的 ...
  • 当您可以轻松地使用函数执行它时,定义alias不是正确的方法,并使用bash ,算术运算符$(()) function mins_ago() { printf "%s" "$(( $(date +%s) - (60 * $1) ))" } 在.bash_profile添加上面的函数,现在在命令行中测试它, date +%s 1485414114 value="$(mins_ago 3)" printf "%s\n" "$value" 1485413834 (或)没有临时变量在GNU date转 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)