1 PackageCom.xunhuan;2 3 Public classZUOYE02 {4 5 Public Static voidMain (string[] args) {6 intA = 0;7 intb = 1 ;8 Do {9 if(b%7==0) {//First Judge B is not the remainder, if there is no remainder proof is a multiple of 7TenA=a+b;//calculates the number of the other with a multiple of 7 One}b++; A} while(B//B is less than - System.out.println (a); - the } - -}Java Fundamentals (fifth post-
1 PackageCom.xunhuan;2 3 ImportJava.util.Scanner;4 5 Public classZuoYe03 {6 7 8 Public Static voidMain (string[] args) {9Scanner meng00=NewScanner (system.in);Ten One A intmun; - intMax=0; - intMin=0; the - //Enter Do...while loop output - Do { -System.out.println ("Please enter a number (enter 0 to end)"); +Mun =meng00.nextint (); - if(mun!=0) {//If you determine the number of inputs if not equal to 0, enter
Moonphases
(read/write) Number of lines of code
Post a blog volume/comment on the number of others ' blogs
Time after school (hours)
Learn the most rewarding program reading or programming tasks
First week
20/10
1/0
5
Output 99 multiplication table using the Elipse development program
Second week
60/20
1/0
6
Experiment Seven experiment Five
Third week
Week F
Implementing the Runnable Interface
Run method in sub-overlay interface
Thread is created through the thread class and the subclass object that implements the Runnable interface is passed as a parameter to threadConstructors for classes
The thread class object calls the Start method to open threads
The thread starts with the Start methodCauses of security problemsMultiple threads are now delayedThread RandomnessThe thread safety problem is not easy to appear in the ideal state, but o
1. What is an object? What is a class?Relationship of classes and objectsMethods for defining classesMethod Five ElementsNew keywordAssignment of a reference type variableNull and NullexceptionThe difference between null and lowercase2. MethodsOverloading and overridingConstruction method, with parameter constructionThe This keyword, which can be overloadedArray of reference types3. Memory ManagementLife cycle of member variablesGarbage collection mechanismStack, heap, method areaMethod has only
JAVA course 31st (Common Object API)-StringBuffer Class amp; StringBuilder class
StringBuffer class
The principle of string composition is implemented through this class
StringBuffer can add or delete string content
StringBuffer is a container
Many methods are the same as strings.
I. Features
StringBuffer string buffer, used to store data in containers
1. Variable Length
2. Different data types can be st
Common operationsArray// Declaration * Array is also an object, length is an attribute int [] i=newint[5]; int [] i={0,1}; String[] str=newstring[5]; // string array, double quotation marks, distinguished from char character array String [] str={"A", "B"};//Find the length array at the beginning , the length is determined (just a property, ' \ ' is useless)Reference: http://www.cnblogs.com/entry-android/p/5539362.htmlN=charset.length;Array of stringsThe length does not end with a terminator;Inh
1 PackageCom.xunhuan;2 3 Public classZuoYe004 {4 5 Public Static voidMain (string[] args) {6 intMen ;7 intwomen;8 intKids;9 //The number of men is less or equal to 10, on this basis the self-addedTen for(men=0;men){ One for(women=0;women//women are equal to 30 people. A if(30-men-women >= 0) {//If you use 30 total-men-the number of women results is greater than or equal to 0, the number of children -
using the class's static fields and constructors, we can track the number of objects created by a class. Write a class that can query it at any time "how many objects have you created?" " Public classClass { Public Static voidMain (string[] args) {//TODO auto-generated Method StubClass a=NewClass (); Class b=NewClass (); System. out. println ("created a"+class.value+"an Object"); } //static fields Static intValue=0; PublicClass () {//constructor FunctionValue=value+1; }}
background image, set in the Layeredpane layer, the other containers are set transparent to make the background picture visibleFour, I am responsible for the main function display and code analysis of the main interface:Code Analysis: New interface when clicking a buttonMall:Code Analysis: According to the input product number of the corresponding key in the map of the commodity class good instance, if the shopping cart ArrayList does not have this good, then directly join, if already exist, on
patterns, the data Accessor mode and the Active domain object (domain objects) pattern . The data Accessor mode enables the separation of access and business logic, and the Active Domain object mode enables the object encapsulation of business data.Two. The formation of DAO patternsA typical DAO implementation has the following components:
A DAO interface;
A concrete class to implement DAO interface;
Data passing Object (DTO): Sometimes called value object (VO) or domain model
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.