java openpgp example

Want to know java openpgp example? we have a huge selection of java openpgp example information on alibabacloud.com

Java code example (5)

); $ $ } -}1 /**2 * Demand Analysis: Use a two-dimensional array to store three class students ' scores and calculate the total score of three class students3 * @authorChenyanlong4 * Date: 2017/10/145 */6 Packagecom.hp.test05;7 8 Importjava.util.Arrays;9 ImportJava.util.Scanner;Ten One Public classHs_array3 { A - Public Static voidMain (string[] args) { - the int[] array=New int[][]{{2,1},{2,1,3},{2,1}}; - for(inti=0;i){ -String str= (i+1) +

Java example: Creating JavaBean from the contents of a Map object

Java provides a java.beans.Introspector class that helps us analyze which properties are in the JavaBean class, which makes it easy to value and assign JavaBean object properties. The following is an example of creating a JavaBean object based on the contents of the Map object. 01.import Java.beans.BeanInfo; 02.import java.beans.IntrospectionException; 03.import Java.beans.Introspector; 04.import Java.be

Implementation of single example in Java multithreaded programming

problematic:Since Singleton = new Singleton () is executed, the JVM is performed in two steps, first reserving space for Singleton, assigning it directly to instance, then initializing Singleton, creating Singleton instances,If a first enters singleton = new Ssingleton (), but only allocates space and does not initialize, it returns Singleton, and when the B thread enters, Singleton is not null. Then will directly return to the existing singleton, if the singleton real initialization before the

Java writing example equals (), etc.

Equals ()Implement Equals ()Parameter must be an object, not a perimeter classWhen overriding Equals (), also overwrite the corresponding hashcode (), consistent with Equals ()Also note that the default value of string is nullpublic class Person {private String name;private int birthyear;byte[] raw;Java writing example equals (), etc.

Java multi-producer multi-consumer example

();}finally{Lock.unlock ();}}Public Void Get (){Lock.lock ();try {While (!flag)consumer_con.await ();System.out.println (Thread.CurrentThread (). GetName () + ".... Consumers ... "+this.name);Flag=false;producer_con.signal ();} catch (Interruptedexception e) {//TODO auto-generated catch blocke.printstacktrace ();}finally{Lock.unlock ();}}}class Producer implements Runnable{Resource R=null;Public Producer (Resource R){This.r=r;}public void Run () {TODO auto-generated method stubswhile (true)R.se

Java-Preliminary Understanding-13th Chapter-deadlock Example

true and the other is false.Only this situation occurs when multiple tasks do not matter, because you perform either True or FALSE, only in both cases.The resource encapsulated in my thread task is a Boolean variable, although this variable has a separate copy of the two task objects, but the obtained value can only be two, either true or false. If this is not flag, but Num,int num=100, then it will be discarded, which results in two thread tasks performing two 100.We can also not call the cons

Java Socket Basics Example

clientDos.writeutf ("Accept connection request, connection successful!")); //when you do not need to continue using this connection, close the connectionSocket.close ();   Ss.close (); } Catch(IOException e) {e.printstacktrace (); }}}2. Client code PackageCom.lanber.socket;import Java.io.DataInputStream;ImportJava.io.dataoutputstream;import java.io.IOException;ImportJava.io.OutputStream;ImportJava.net.Socket;Importjava.net.UnknownHostException; Public classClientdemo {/***@paramargs*/    Pu

Java learning two-output graphics example

Package basicproject; Public class tuxing extends Basic { Public void Picture1 () { final int COUNT = ten; int row = 5; For (int i=1; iRow; i++) {For (int k=0; ki; k++) { if (k==0) { System. Out. Print (""); }else { System. Out. Print (""); } }For (int j=0; jCOUNT; J + +) { if (j!=COUNT) { System. Out. Print ("*"); }else { System. Out. Print ("*" +"\ n"); } } }}Public void picture2 () { int c

Java A simple example of displaying source code separately from GIF animated pictures

Package com.image.util;Import Java.io.File;Import Javax.imageio.spi.ImageReaderSpi;Import Javax.imageio.spi.ImageWriterSpi;Import Javax.imageio.stream.FileImageInputStream;Import Javax.imageio.stream.FileImageOutputStream;Import com.sun.imageio.plugins.gif.*;public class Testmain {@SuppressWarnings ("restriction")public static void Main (string[] args) throws Exception {File File = new file ("D:\\xx.gif");Fileimageinputstream in = new Fileimageinputstream (file);Gifimagereader reader = null;Imag

Java replication equals example

Public classusers {String name; Static intAge ; Public Booleanequals (Object obj) {if( This==obj) { return true; } BooleanB=objinstanceofusers; if(b) {users U=(users) obj; if(users.age==u.age This. Name.equals (U.name)) { return true; } Else { return false; } } Else { return false; } } Public Static voidMain (string[] args) {users U1=Newusers (); Users U2=Newusers (); Users U3=U1; U1.name= "Zhangsan"; U1.

An example of the principle of Java EJB encryption and decryption _php tips

An example of the principle of encryption and decryption Package lockunlock; Import java.awt.*; Import java.awt.event.*; Import java. applet.*; Import javax. swing.*; Import java.util.*; public class Lockunlock extends JApplet { Private Boolean isstandalone = false; Get a parameter value public string GetParameter (string key, String def) { Return Isstandalone? System.getproperty (Key, Def): (GetParameter

Java implementation simple Word wildcard Builder code example _java

The Creates a successful string object whose length is fixed and cannot be modified and edited. Although you can use "+" to add new characters or strings, "+" produces a new instance of string that creates new strings objects in memory. If you repeatedly modify the string, you will greatly increase the overhead of the system. J2SE has increased the String-builder class of variable character sequences from 5.0, greatly increasing the efficiency of increasing strings frequently. Let's look at a s

TestNG TimeOut Example (Java Unit Test @test TimeOut)

"The other tutorials in this series are being translated and clicked on Category: TestNG for viewing." 】 "Translation by mingming like the month QQ 605283073" Original: http://websystique.com/java/testing/testng-timeout-example/ This article describes the timeout for testng tests. The TestNG timeout attribute can be implemented through @test (timeOut = 1000) annotations. If a test method with @test annotat

A simple example of Java reading the contents of an Excel file _java

With the help of Apathe's Poi.jar, the upload file does not support. jar so please download and change the file to. jar, add the Poi.jar package to the application, and put the Excel file you want to read into the root directory This example uses Java to read the contents of Excel and display the results, the code reads as follows: Copy Code code as follows: Import Java.io.BufferedInputStream;

Example of a method that converts the Java list structure to JSON through the Gson library _java

Discovered Google's Gson, because before for protocolbuf some understanding, with some curiosity, I began to use the Gson.GitHub Home: Https://github.com/google/gsonBy comparison, Gson and other existing Java JSON class libraries have the greatest difference when Gson need to serialize the entity classes do not need to use annotation to identify the fields that need to be serialized, while Gson can flexibly configure the fields that need to be seriali

Basic MVC Example Analysis of Java Web implementation _jsp programming

This example describes the basic MVC of Java Web implementations. Share to everyone for your reference. Specifically as follows: Input file for login.jsp--view sectionOutput file for success.jsp--View sectionOutput file for failure.jsp--View sectionloginbean.java--Model Sectionloginservlet.java--Controller SectionWeb.xml--web application configuration file The following are described separately: 1, login

Java parseint Explanation Plus Method Example _java

Java parseint () Syntax: static int parseint (String s) static int parseint (String s, int radix) Parameter: string s: Represents a representation of a decimal string int radix: means to convert a string to an integer For example: int c=integer.parseint ("12", 8); That will be understood as double quotes in the 12 is a octal number, that is, binary 1010, converted to decimal is 10 Application Examples:

Example to explain how to use Layout manager in Java

Many beginners use the Java layout to automatically layout the interface, often encounter problems such as not knowing how to define the area size or the distance between the buttons. In fact, automatic layout can also solve the definition of area size or the distance between buttons, and so on, but not the manual layout so flexible. Let me give you an example. First, build a frame file (application applica

Java Selenium Action Pop-up dialog box example to explain _java

Web developers often need to use the JavaScript pop-up dialog box to give users some informational hints, including the following types Reading Table of Contents dialog box type Test page Code for the Selenium Action dialog box dialog box type 1. Warning Boxes: Validation results, errors or warnings for prompting user related information 2. Hint box: Used to prompt the user to enter data in the current dialog box, generally require the user click Cancel or Confirm button

Example parsing java synchronized keyword and thread safety problem _ practical skills

method object. That is, when an object P1 the synchronization method in a different thread, they form a mutex that achieves the effect of synchronization. But another object generated by the class that this object belongs to P2 can invoke the method that was added to the Synchronized keyword arbitrarily.The example code above is equivalent to the following code: public void Methodaaa () { synchronized (this)//(1) { //... } }} (1)

Total Pages: 15 1 .... 10 11 12 13 14 15 Go to: Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.