) {Scanner scan=new Scanner (system.in);System.out.print ("Please enter five number:");Double a=scan.nextdouble ();Double b=scan.nextdouble ();Double c=scan.nextdouble ();Double d=scan.nextdouble ();Double e=scan.nextdouble ();Double sum=a+b+c+d+e;Double product=a*b*c*d*e;System.out.println ("The sum of five data is:" +sum+ "\ n Five data of the product is:" +product);}}4. Enter 3 numbers from the keyboard, an int type data, a double type, a float type data, and a sum of 3 numbers.Import Java.ut
shadow part is the exported certificate, and the end isCERTThe blue part is manually exported and placed in the corresponding folderJarPackage. You can name the shadow part by yourself.
The key password entered for the first time. The certificate and signature will be exported later.JarPackage is required. The first step is to enter the name, unit, and other information required to generate the key.
After the signature is complete, you can directlyJarUsed in the project. First loadApp
Title: Imitate the Javaapparguments.java instance, write a program that accepts multiple numbers from the command line, and then outputs the sum.1. Design IdeasThe parameters you enter are strings, and you want to make them into numbers before you add them. Because you do not know how many parameters to enter, enter n for the For loop. Finally, the sum of these numbers is entered and the final sum is obtained.2. Program FlowchartDefine the number of arguments n and enter n-----------> enter the
(); } System.out.println ("turn off NetEase Cloud music"); } public static void main (string[] Args) {timer timer = new Timer ();//time controller timer.schedule (new timertask () { public void Run () {haowan Haowan = new Haowan (); Haowan.runbat ("start"); }}, 3000, 300000);//3 Second start running NetEase cloud music every 5 minutes seconds to restart the timer timer2 = new Timer ();//time Controller Timer.schedule (new timertask () {
4-order matrix and the column number of the row number, the code is as follows:1 Public classMaxmindemo {2 Public Static voidMain (String args[]) {3 4 intarr[][]={{36,45,90,3},{24,39,10,4},{36,72,66,5},{64,88,120,6}};5 intI,j,m=0,n=0,a=0,b=0;6 intMax=arr[0][0],min=arr[3][3];7 8System.out.println ("4-Order matrix:");9 for(i=0;i){Ten for(j=0;j){ OneSystem.out.print (arr[i][j]+ ""); A - if(maxArr[i
The first Java written by 1.2.2
Public
class Hellow world{
//Program Framework
Public
static void Main (String [] args) {
//main Method Framework
System.out.println ("Hello world! ");
//Code output statement written
}
}
Note:
single-line comment//
Multiline Comment/* *
/
The first
("Please enter a month:");int month = Scan.nextint ();--Define a variable: Determine whether it is a leap year (true) or common year (false)Boolean flag = true;if (year%400==0| | (year%4==0year%100>0)) {Flag = true;System.out.println (year+ "Years is a leap year");}else{Flag = false;SYSTEM.OUT.PRINTLN (year+ "Year is common year"); }--1, 3, 5, 7, 8, 10, 12 are all 31 days, others except February, are 30 daysif (month==1| | month==3| | month==5| | month==7| | month==8| |month==10| | MONTH==12){S
Operation Result:650) this.width=650; "src=" http://img.blog.csdn.net/20150724144448636 "alt=" here write a picture describing "title=" "/>650) this.width=650; "src=" http://img.blog.csdn.net/20150724144516764 "alt=" here write a picture describing "title=" "/>This article is from the "Sanghaidan blog column" blog, please be sure to keep this source http://10602803.blog.51cto.com/10592803/1683073Add button \ Applet viewer.
;} else if (target = = 2) {return 2;} else{Return (Jumpfloor (target-1) +jumpfloor (target-2));}}public static void Main (string[] args) {Solution s = new solution ();System.out.println (S.jumpfloor (3));}}9. A frog can jump up to 1 steps at a time, or jump up to level 2 ... It can also jump on n levels. Ask the frog to jump on an n-level step with a total number of hops.A) The problem-solving steps are similar to the previous one, as well as the Fibonacci sequence.public class Solution {public
Simple text editing Box applet:Import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.io.*;class TextEditorFrame extends JFrame{ File File=null; Color color=color.red; Texteditorframe () {Inittextpane (); Initaboutdialog (); Inittoolbar (); Initmenu (); } void Inittextpane () {Getcontentpane (). Add (new JScrollPane (text)); } jtextpane text=new Jtextpane (); This is used to make the text box of the JFileChooser filechooser=new JFileChooser (); File selectio
/*Guess number game:1, generating a random number.2, get keyboard entry.3, the input data into a number, and the random number comparison.Give a hint.4, repeat the process, if guessed, the program is over.Note: For numbers other than input 1~100, as well as non-numbers to give a hint.*/Import java.io.*;Import java.util.*;Class Guessnumber{private int rannum;Guessnumber (){Random r = new Random ();Rannum = R.nextint (+) +1;//(int) math.random () *100+1;} public void Play () { system.out.println
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.