java 根据类名示例化类_Java类类getProtectionDomain()方法及示例

java 根据类名示例化类

类class getProtectionDomain()方法 (Class class getProtectionDomain() method)

  • getProtectionDomain() method is available in java.lang package.

    getProtectionDomain()方法在java.lang包中可用。

  • getProtectionDomain() method is used to return the ProtectionDomain of this class (i.e. ProtectionDomain protects source code by implementing a set of permissions).

    getProtectionDomain()方法用于返回此类的ProtectionDomain(即ProtectionDomain通过实现一组权限来保护源代码)。

  • getProtectionDomain() method is a non-static method, it is accessible with the class objects only and if we try to access the method with the class name then we will get an error.

    getProtectionDomain()方法是一个非静态方法,只能使用类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。

  • getProtectionDomain() method may throw an exception at the time of returning ProtectionDomain of the class.

    返回该类的ProtectionDomain时, getProtectionDomain()方法可能会引发异常。

    SecurityException : In this exception its checkPermission() method restricts ProtectionDomain when security manager exists.

    SecurityException:在此异常中,当安全管理器存在时,其checkPermission()方法将对ProtectionDomain进行限制。

Syntax:

句法:

    public ProtectionDomain getProtectionDomain();

Parameter(s):

参数:

  • It does not accept any parameter.

    它不接受任何参数。

Return value:

返回值:

The return type of this method is ProtectionDomain, it returns the ProtectionDomain of the class.

该方法的返回类型为ProtectionDomain ,它返回该类的ProtectionDomain。

Example:

例:

// Java program to demonstrate the example 
// of ProtectionDomain getProtectionDomain() method of Class 
import java.security.*;
public class GetProtectionDomainOfClass {
public static void main(String[] args) throws Exception {
// Get Class object
Class cl = Class.forName("java.util.ArrayList");
// It return the ProtectionDomain of the class ArrayList
ProtectionDomain pd = cl.getProtectionDomain();
// Display ProtectionDomain of the class
System.out.print("ArrayList ProtectionDomain : ");
System.out.println(pd);
}
}

Output

输出量

ArrayList ProtectionDomain : ProtectionDomain  nullnull<no principals>[email protected] (("java.security.AllPermission" "<all permissions<" "<all actions>")
)

翻译自: https://www.includehelp.com/java/class-class-getprotectiondomain-method-with-example.aspx

java 根据类名示例化类

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/380001.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

snagit 9.0注册码

8.0的注册码 A5CCU-RYNM4-C9ECC-5CWW9-B5R7B 5HCC5-4CCC9-NGXCM-XYDZ5-H6ER6 HLHAD-2CZLC-8XYDC-CC5CB-P289A D5DSC-WZCBM-JRHSC-QVTEV-TR7R8 snagit 9.0: name:Team Z.W.T sn:XMYU5-9CMBC-5SLBZ-DKML2-JE8M5 谢谢 name:Team Z.W.T sn: WDYMP-8ALRM-GVVV2-PH8VK-6MD27 Z…

vue3 配置 @符号

config,ts 配置 有 爆红 安装 npm install 一下 然后 配置 路径提示功能 tsconfig.json 配置 路径提示功能 一共这两个路径配置

android 页面转换

通过setContentView来改变布局 很简单 ViewchangeActivity.java package idrc.change;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;public class ViewchangeActivity extends Activity {/** Called when the…

mts模式_MTS的完整形式是什么?

mts模式MTS&#xff1a;Microsoft Transaction Server /移动电话服务/多通道电视声音 (MTS: Microsoft Transaction Server/ Mobile Telephone Service/ Multichannel Television Sound) 1)MTS&#xff1a;Microsoft Transaction Server (1) MTS: Microsoft Transaction Server…

Java——IO流

一&#xff0c;IO流常识 Ⅰ&#xff0c;IO流的概述 1&#xff0c;IO流用来处理设备之间的数据传输 2&#xff0c;Java对数据的操作都是通过流的方式 3&#xff0c;Java用于操作流的类都在IO包中 4&#xff0c;流 按流向分为&#xff1a; ①输入流 ②输出流 5&#xff0…

JBE、JNBE、JA、JL指令详解(从原理上)

JBE 当执行到JBE命令时&#xff0c;如果此时的CF标志位或者ZF标志位为1&#xff0c;跳转&#xff0c;其他不跳转 相当于小于等于命令 cmp eax&#xff0c;ecx jbe 0040100c执行到cmp命令时&#xff0c;如果此时的eac小于等于ecx&#xff0c;jbe都会跳转到0040100c 因为小于的…

数组shift方法_数组shift()方法以及JavaScript中的示例

数组shift方法JavaScript shift()方法 (JavaScript shift() method) shift() method is used to remove the first element of an array and returns the deleted element. shift()方法用于删除数组的第一个元素&#xff0c;并返回删除的元素。 It changes the array length. …

ArcMap 9使用技巧

ArcMap 9使用技巧技巧1 重叠要素的选择切换目标&#xff1a;在覆盖同一区域的多个要素中切换被选择要素操作步骤&#xff1a;1&#xff0e;在编辑环境中选中覆盖同一区域的多个要素中的一个要素2&#xff0e;按下N 键&#xff0c;被选要素就会自动地切换到另一个图层的要素3&am…

《软件》2011年第6期刊登出 《DB 查询分析器》中断SQL语句的执行

《软件》编辑部寄来了2011年第6期样刊&#xff0c;在2011年第6期&#xff0c;刊登出了本人的论文------“《DB 查询分析器》中断SQL语句的执行”。 论文刊登在第42页&#xff0c;排在第13篇&#xff0c;还比较靠前&#xff0c;呵呵。 在“万方数据”和“中国期刊全文数据库”中…

Java——IO流(序列流)

序列化与反序列化 游戏存档&#xff1a;目的是为了游戏下次上号数据的保存 package com.yy.otherio;import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; im…

ret2libc过地址随机化

程序&#xff1a; #include<stdio.h> char buf2[10] "this is buf2"; void vul() {char buf1[10];gets(buf1); } void main() {write(1,"sinxx",5);vul(); }很明显&#xff0c;gets函数存在溢出 编译&#xff1a; gcc -no-pie -fno-stack-protect…

[导入]Lucene并发访问

作者: yagesi 链接&#xff1a;http://yagesi.javaeye.com/blog/165604 发表时间: 2008年02月27日 声明&#xff1a;本文系JavaEye网站发布的原创博客文章&#xff0c;未经作者书面许可&#xff0c;严禁任何网站转载本文&#xff0c;否则必将追究法律责任&#xff01; 在Luce…

Python程序计算给定文本中单词的出现

Given a text (paragraph) and a word whose occurrence to be found in the text/paragraph, we have to find the how many times word is repeated in the text. 给定一个文本 (段落)&#xff0c;其出现在文本/段落被找到的单词 &#xff0c;我们必须找到如何词多次在文本重…

js私有共有成员

在小项目中对于JavaScript使用&#xff0c;只要写几个function就行了。但在大型项目中&#xff0c;尤其是在开发追求 良好的用户体验的网站中&#xff0c;如SNS,就会 用到大量的JavaScrpt&#xff0c;有时JavaScript的工作量胜过了C#&#xff0c;这时写一堆function,就会显得很…

Java——IO(打印流)

1&#xff0c;打印字节流(PrintStream)的概述&#xff1a; 打印流可以很方便的将对象的toString()结果输出并且自动加上换行&#xff0c;而且可以使用自动刷出的模式 System.out就是一个PrintStream&#xff0c;其默认向控制台输出信息 2&#xff0c;使用方式&#xff1a; …

MATLAB中的正态分布检验

要对一组样本进行正态性检验&#xff0c;在MATLAB中&#xff0c;一种方法是用normplot画出样本&#xff0c;如果都分布在一条直线上&#xff0c;则表明样本来自正态分布&#xff0c;否则是非正态分布。 MATLAB中也提供了几种更正式的检验方法&#xff1a;kstest Kolmogorov-Smi…

远控免杀专题(29)-C#加载shellcode免杀-5种方式(VT免杀率8-70)

0x00 免杀能力一览表 几点说明&#xff1a; 1、表中标识 √ 说明相应杀毒软件未检测出病毒&#xff0c;也就是代表了Bypass。 2、为了更好的对比效果&#xff0c;大部分测试payload均使用msf的windows/meterperter/reverse_tcp模块生成。 3、由于本机测试时只是安装了360全家…

kotlin 或 运算_Kotlin程序对两个数字执行算术运算

kotlin 或 运算Here, we are implementing a Kotlin program to perform various arithmetic operations on two numbers. 在这里&#xff0c;我们正在实现Kotlin程序&#xff0c;以对两个数字执行各种算术运算 。 Given two numbers a and b, we have to find addition, sub…

2012.1.15---学习笔记

最近学习实践的内容主要有&#xff1a;1 memcahche的安装、使用&#xff08;为了减少数据库压力而采用的&#xff09;2 linux下的定时任务的配置&#xff0c;crontab3 如何去编写可配置的php程序&#xff08;加载配置文件&#xff09;1 memcahche的安装、使用&#xff08;为了减…

WPF界面设计技巧(2)—自定义漂亮的按钮样式

上次做了个很酷的不规则窗体&#xff0c;这次我们来弄点好看的按钮出来&#xff0c;此次将采用纯代码来设计按钮样式&#xff0c;不需要 Microsoft Expression Design 辅助了。 首先打开 Microsoft Visual Studio 2008 &#xff0c;新建一个WPF项目&#xff0c;在上面随便放几个…