Alexander the weft written summary

Alexander received a written invitation to the latitude of the company, named after the title of a basis for comparison, it is relatively simple.

But some still do when the subject is not a hundred percent sure, hereby record it, consolidate and review the basics of their own

 

Multiple choice
concept below, does not belong to the object-oriented approach is ()
A. objects, message
B. inheritance, polymorphism
C., a package
D. Procedure Call

The answer: D
[resolved] object-oriented programming methods, objects, methods, properties and inheritance and polymorphism. Object-oriented methods is - kind of use objects, classes, encapsulation, inheritance, polymorphism, and concepts like configuration message, testing methods, reconstruction software. Object-oriented approach starting from the target, the development of objects, classes, messages, and inheritance concepts.

The following description of the error is the constructor ()
Returns the value A, the constructor may be any type
B, it is a special constructor function of the class, and its class name and method name must be the same as
a major role C, constructor is subject to the completion of the class initialization
D, generally when you create a new object, the system will automatically call the constructor

Answer: A
[D] constructor without any return value, named must be consistent with the class name, for instance of the object class.

Which of the following definition of the interface is correct? ()
A, interface B
{void Print () {};}
B, abstract interface B
{void Print ();}
C, the extends abstract interface B A1, A2 // A1, A2 interface is defined as
{abstract void print () {};}
D, interface B
{void Print ();}

Answer: D
Method [D] interface default public abstract, property defaults to public static final. Interface methods can not have implementation bodies, Java only supports single class inheritance, but the interface can support multiple inheritance.

A to subclass B, B to subclass C, and the following statement in the Java source code:

A new new A0 = A ();
A a1 = new new B ();
A a2 = new new C ();
which asked the following statement is true? ()

A, only the first line by the compiler
. B, row 2 compiles, but the third line compiler errors
. C, line compiles 2,3, 2,3 but error row run
D, the first line 1, line 2 and the declaration line 3 is correct

Answer: D
[D] inheritance is transitive, subclasses unconditional upcast

Run the following program, what would be the result of ()
public X-the extends the Thread class the implements the Runnable {
public void RUN () {
System.out.println ( "the this IS RUN ()");
}
public static void main (String [] args) {
the Thread the Thread new new T = (X-new new ());
t.start ();
}
}
A, the first line gives compiler error
B, the sixth line gives compiler error
C, the sixth row will generate an error operation
D, and the program will start running

The answer: D
[resolved] pro-test program can run multi-threaded can either inherit the Thread class, but also implement Runnable

Which of the following keyword is used to define a class that implements the interface? ()  
A, the extends (inheritance) B, implements (achieve) C, abstract (Abstract) D, interface (interface)

The answer: B
[resolve] extends inheritance, abstract abstract, interface definition of the interface, implements implements the interface

If the definition of the class definition in one of the following methods: abstract void sum (); This method belongs to ()
A, interface method
B, the final method
C, abstract method
D, empty method

The answer: C
[resolved] abstract definition of abstract methods

Given the code below, the program on which the following statement is true? ()
Public the Person class {
static int ARR [] = new new int [. 5];
public static void main (String A []) {
System.out.println (ARR [0]);
}
}
A, compile-time error is generated B, compile correctly, the run-time error
C, the output D to zero, outputs an empty

Answer: C
[parse] int type array default initialization value 0

Which of the following does not belong to the document object's method options? ()
A, Focus ()
B, getElementById ()
C, getElementsByName ()
D, bgColor ()

D: The answer
Method [D] bgColor () does not belong to the document object

The method of obtaining the following values of the input block is correct ()
A, document.getElementByld ( "INPUT") Val ();.
B, document.getElementByld ( "INPUT ') .Value ();
C, $ (" #INPUT " ) .val ();
D, $ ( "#INPUT") value ().;

Answer: C
[D] Gets the value input box methods: document.getElementByld ( "input ') .value ; and
$ (" #input ") val ( );.

SQL statement command table structure is modified ()
A, the MODIFY TABLE
B, the MODIFY STRUCTURE
C, the ALTER TABLE
D, the ALTER STRUCTURE

The answer: C
[resolved] alter is for the whole table, modify is a particular field in the table to be modified. Operating table structure are modified with the alter table command to complete.

Oracle, there is a named sequence object seq, the following statement can return without causing sequence values the sequence value is increased ()
A. Dual SELECT seq.ROWNUM from
B. SELECT seq.ROWID from Dual
C. SELECT seq. Dual from CURRVAL
D. seq.NEXTVAL from the SELECT Dual

The answer: C
[resolved] calling NEXTVAL will generate the next sequence serial number, CURRVAL for the current value of the generated sequence, no matter how many times will not call the next sequence of values.

A car of a plurality of component parts, and the same parts suitable for different models of cars, contact between the car and spare parts entity set entity set is ______.
A. 1: M
B. 1: 1
C. M: 1
D. M: N

The answer: D
[resolve] a car from a plurality of component parts, and the same parts suitable for different models of cars, contact between the car and spare parts entity set entity set is a link-many.

Below concerning the correct index is () 
A. can not create a composite index on multiple columns. 
B. You can create a composite index on multiple columns.  
C. The data in column index can not be repeated.  
D. The data in the index column must be numeric.

Answer: B
[Analysis] The user can establish a plurality of columns in the index, this index is called a composite index (combination index)

Indefinite item selection
following statement regarding the java interface is correct ()
A. All interfaces are public methods of
B. Keyword is used to define the interface is expends
C. void adjust (); this is a correct statement of the interface definition
D. Interface classes need to be declared with the interface

The answer: ACD
[resolved] for keyword defines an interface is interface, the interface members of the public abstract method is the default modifier

The following correct statement is a one-dimensional array ().
A. String [] A
B. A String []
C. A char [] []
D. String A [10]

Answer: AB
[parse] a two-dimensional array C, D define the length of an array of 10: String a [] = new String [10];

About readLine BufferedReader class () method, the following statement is correct ().
A. The method of the readLine () to read each line of data.
B. The method of the readLine () to read one byte.
C. The method may throws IOException, when the method is called it should be generally in a try block and the catch block via the processing exception.
D. If the read end of the stream, the method returns the result is null.

The answer: ACD
[resolved] public String readLine () to read a line of text. By any one of a line can be considered terminated: line feed ( '\ n'), followed immediately after the carriage return linefeed ( '\ r') or a carriage return. Returns: a string that contains the contents of the line, not including any line terminator, if the end of the stream, null is returned. Throws: IOException - if I / O error occurred

Class is an abstract class B, class C is a non-abstract subclass of class B, the following create objects x1 statement is correct?
(A) .B x1 = new new B ()
(B) .B new new C x1 = ( )
© .C new new X1 = C ()
(D) .C new new X1 = B ()

Answer: the BC
[Analysis] C may of course be non-abstract class instance own objects, it is the correct C.
X1 and abstract parent class B may be instantiated by a non-abstract subclasses C, B it is also correct this usage generally. for dynamic polymorphism.

Jsp following are annotated with () (multiple choice)
A, <% - and -%>      
B, / 
C, / and ** ** /    
D, <-! - and - ->

The answer: AD
[resolved] 1 first NOTE:
This is the HTML / XML's original comments will be sent to the client honestly, what people can not see do not use this to write
2. The second comment: <% - comment content -%>
had <%%> things that are written JSP application server to see, will not be sent to the client. The compiler will ignore it, html also missed its meet, sideline the application server. This comment feel more redundant, I do not know specifically what they engage in a such a comment.
3. The third NOTE:
<%
@ When line comments
/ * * multi-line comment * /
%>

Known following code:
public class the Test {
public static void main (String SRGS []) {
int I =. 5;
do {
System.out.println (I);
} the while (-i>. 5);
System.out.println ( "Finished");
}
}
what outputs is performed () selected from the two
a,. 5
B,. 4
C,. 6
D, Finished
E, None

The answer: AD
[resolved] do ... while loop to perform an after determining whether the conditions to continue

下面哪个语句关于GROUP BY 和HAVING语句的使用是正确的?
A. SELECT JOB_ID , DEPARTMENT_ID , AVG(SALARY)
FROM EMPLOYEES GROUP BY JOB_ID HAVING AVG(SALARY) > 3000;
B. SELECT JOB_ID , DEPARTMENT_ID , AVG(SALARY)
FROM EMPLOYEES GROUP BY JOB_ID ,DEPARTMENT_ID HAVING AVG(SALARY) > 3000;
C. SELECT JOB_ID , DEPARTMENT_ID , AVG(SALARY)
FROM EMPLOYEES GROUP BY AVG(SALARY) HAVING AVG(SALARY) > 3000;
D. SELECT JOB_ID , DEPARTMENT_ID , AVG(SALARY)
FROM EMPLOYEES GROUP BY JOB_ID , DEPARTMENT_ID HAVING SALARY > 3000;

Answer: A
[parse] GROUP BY packet field; field after the query packet: packet fields, aggregate functions. HAVING aggregate functions can be determined.

Zhang query students the following statement is not correct ()
A. SELECT * FROM STUD WHERE name = "Zhang%%"
B. SELECT * FROM STUD WHERE name LIKE "Zhang"
C. SELECT * FROM STUD WHERE name LIKE "Zhang%"
D. SELECT * FROM STUD WHERE name = "Zhang"

The answer: ABD
[resolved] can use the query criteria in the WHERE clause predicate LIKE implements a character match. LIKE predicate general form of "column name string constant LIKE", wherein the data type of the column names must be character, may be used in some special characters to match the character string constant. Character% (percent) can be represented by an arbitrary length string matching.

The following statement is correct ()
A, the Spring is a lightweight framework that simplifies the development of enterprise java
B, Spring is a one-stop enterprise application development choices, can replace other existing frameworks
C, Spring Framework basic Spring Core module is part of, and dependency injection provides Ioc
D, Spring AOP oriented programming is to achieve a compliant Spring Core based on the

The answer: ACD
[resolved] Spring is a layered JavaSE / EE full-stack (stop) a lightweight open source framework.

A new window opens name the JavaScript syntax? ()
A, Open ( "HTTP: //www.dfrge.cn")
B, new.window ( "HTTP: // www.dfrge.cn") 
C, new new ( "HTTP: // www.dfrge.cn ")
D, window.open (" HTTP: // www.dfrge.cn ")

The answer: AD
[resolved] open () method or find a new browser window already exists.

Program title
1, reading of the following program, write the result of the program:
public class ABC {
public static void main (String args []) {
int I, S = 0;
int A [] = {10, 20 is, 30, 40, 50, 60, 70, 80, 90};
for (I = 0; I <a.length; I ++) {
IF (A [I] == 0. 3%) {
S = A + [I];
}
}
System.out.println ( "S =" + S);
}
}

2, reading of the following program, write the result of the program:
public class Father {  
int A = 100;  
public void Miner () { 
 A-;  
}
public static void main (String [] args) {
Son new new Son Y = ();  
System.out.println (Ya);  
System.out.println (y.getA ());  
y.miner (); 
System.out.println (Ya);
System.out.println (y.getA ());
}
}
class the extends Father Son {  
int A = 0;
public void PLUS () {    
A ++;  
}
public int getA () {  
return super.a;  
}

Answer: The
first question: 180
Second question:
0
100
0
99
each subclass inherits the parent class, changes to the variable is limited to itself, will not affect the value of the variable of the parent class.
Variable parent class and subclass definition of the same name, and does not cover, but each also has its own space, even if the same variable name, subclass the parent class variable assignment of the same name calling, still only change their example out parent class variable value. In other words: the subclass instances out of the parent class with a parent class does not affect the beginning of each other.

 

Enter the date (yyyyMMdd), judgment is the first day of the year

public class aaa {
	public static void main(String[] args) throws ParseException {
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入年月日:");
		String d = sc.next();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
		Date date = sdf.parse(d);
		Calendar c = Calendar.getInstance();
		c.setTime(date);
		System.out.println(c.get(Calendar.DAY_OF_YEAR));
	}
}

Excerpt from the original when Jin fleeting .

Published 113 original articles · won praise 25 · views 30000 +

Guess you like

Origin blog.csdn.net/qq_42006733/article/details/105095734