Home » Java programming language

Java PropertyPermission getActions() Method with Example

PropertyPermission Class getActions() method: Here, we are going to learn about the getActions() method of PropertyPermission Class with its syntax and example.
Submitted by Preeti Jain, on March 21, 2020

PropertyPermission Class getActions() method

  • getActions() method is available in java.util package.
  • getActions() method is used to get the list of current actions in the form of string denotation.
  • getActions() method is a non-static method, it is accessible with the class object only and if we try to access the method with the class name then we will get an error.
  • getActions() method does not throw an exception at the time of getting a set of actions.

Syntax:

    public String getActions();

Parameter(s):

  • It does not accept any parameter.

Return value:

The return type of the method is String, it retrieves the string denotations of the actions.

Example:

// Java program to demonstrate the example 
// of String getActions() method of 
// PropertyPermission

import java.util.*;

public class GetActionsOfPropertyPermission {
 public static void main(String arg[]) {
  // Instantiates two PropertyPermission object
  PropertyPermission prop_perm1 = new PropertyPermission("os.version", "write");
  PropertyPermission prop_perm2 = new PropertyPermission("os.name", "read");

  // By using getActions() method is to
  // returns the action on at the property
  // on the objects prop_perm1, prop_perm2

  String action1 = prop_perm1.getActions();
  String action2 = prop_perm2.getActions();

  // Display action on prop_perm1
  System.out.print("prop_perm1.getActions(): ");
  System.out.println(action1);

  // Display action on prop_perm2
  System.out.print("prop_perm2.getActions(): ");
  System.out.println(action2);
 }
}

Output

prop_perm1.getActions(): write
prop_perm2.getActions(): read






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.