Alibabacloud.com offers a wide variety of articles about java object oriented interview questions, easily find your java object oriented interview questions information here online.
I. Application of the factory model in development
Interview Questions:Write a simple calculator.
Code implementation:
Abstract An operation class:
Package COM. qianyan. calcuator; public abstract class operation {// number one private double num1; // number two private double num2; Public double getnum1 () {return num1;} public void setnum1 (double num1) {This. num1 = num1;} public double getnum2 () {return num2;} public void setnum2 (double num2)
.
64. What are the similarities and differences between JSP and Servlet, and what are their relationships? JSP is an extension of Servlet technology. It is essentially a simple Servlet method, with more emphasis on the external expression of the application. After JSP compilation, it is "servlet-like ". The main difference between Servlet and JSP is that the application logic of Servlet is in the Java file and is completely separated from the HTML in
the value assigned to the variable is immutable, that is, it is a constant. If final modifies an object, it indicatesThe reference assigned to this variable is immutable,What cannot be changed is the reference saved by this variable, and it is not the object pointed to by this reference. In the second case, final has the same meaning as in the first case. ActualFor the first two cases, there is a more appr
attributes of the person class, define the name of this attribute we can write asString name;People have activities, such as talking, talking this behavior is the method in the above statement, the definition of a conversation this method can be written asvoid Talk () {method Body}The method body is the specific execution process that describes the behavior of the conversation. Ii. Creation of objects The person class is created so that we can use it to create an
This is the topic discussed during the last interview and is recorded.
How can I put an object in Hashtable and rewrite it? How to implement it?
Implement a singleton mode? Thread synchronization, delayed loading, and generics are required.
Design and implement a cache management module, which requires that 10,000 objects can be cached.
Design and implement a log module.
Design and implement an
Programming | program | programmer | object | concept
If you've never used an object-oriented language before, you'll need to understand the concept before you start writing Java code. You need to understand what objects are, what classes are, how objects and classes are related, and how messages are communicated betwe
difference between the 5.sendRedirect () and Forward () methods?The Sendredirect () method creates a new request, and the forward () method simply forwards the request to a new target. After redirection (redirect), objects that were within the scope of the previous request are invalidated because a new request is generated, and after forwarding (forwarding), objects within the scope range of the previous request can be accessed. Sendredirect () is generally considered to be slower than forward
method has an exception, it must be done with a try and never be thrown.Summary of Knowledge points1. Inheriting classes and implementing interfacesThe parent class defines the common properties of a class of things, and the interface tends to define the extended functionality of a class of things.2. Use of Throw and throws1) The throw is defined within the function and is used to throw an exception object;2) throws defined on the function, used to t
1. What are the differences between the basic data types in Java and whether the string type is the basic data type.
Six numeric types (four integers, two floating point types), one character type, and one boolean type. Pay attention to the value range of each type. Prevent programs from overflowing the range of this type.
String is a class, not a basic data type. There are also integer classes.
String. indexof ("test") and other methods.
At the same
For Java programmers, mastering object-oriented design theory and some design patterns is an essential skill. To start programming without learning a theory is similar to learning a language without studying the alphabet. There's a lot of object-oriented theory, design patte
or interfaces;}. Name of the method that is overwritten or exclusive to itself or overwritten ();}05. Object-oriented (exception overview)Exception: The exception occurs when the program is running.Exception cause: the problem is also a specific thing in real life. It can also be described in the form of java classes and encapsulated into objects, it is actually
must have a unique formal parameter list to distinguish it from other constructors.When you create a new object, Object Nn=new object (), where parentheses are called constructors.If we write a class, but no constructors are added to the class, the compiler adds a default parameterless constructor to the class. When an objec
constructor method. can be accessed directly with the interface name.Defined:Interface Inter {public static final int COUNT = 100;}Access:Inter.countthird, anonymous objectsAn anonymous object is a statement that creates an object, but does not assign an object address value to a variable.Create a Normal object
Basic java tutorial-object-oriented (1), Basic java tutorial
1. Object-oriented
1.1 java keyboard input
1.1.1 In my opinion, this method is the simplest and most powerful, that is, usin
The Java language provides basic functionality for defining classes, member variables, methods, and so on.Classes can be thought of as a custom data type, you can use classes to define variables, and all variables that use classes to define are reference variables that reference objects to the class.Java object-oriented three major features: encapsulation, inheri
construction method is added by default.When you customize a construction method in a class, the default parameterless construction method disappears (if you need to manually add the method without a parameter). Publiccar{PrivateString color; Permission Modifier Private Public voidsetcolor (String color) { This. color =color; } //This is a set method PublicString GetColor () {...} //This is a Get method } //This is a class, with a common attribute, method; Public Static voidMain
()); the if(m!=NULL){ the M.setname (H1.getname ()); - M.setsex (H1.getsex ()); in } the } the Public voidlist () { About the for(inti=0;i){ the heros[i].print (); the } + } - the Bayi } the the - //Hero Class - classheros{ the PrivateString name; the PrivateString sex; the Private intID; the PublicHeros () { - the } the PublicHeros (String name,string sex,intID) { the This. name=na
Object Memory analysis, I have been learning more vague, today time to tidy up, hope to clarify.First of all, where does the memory analysis come from, which is more obscure to those of us who are just touching Java, starting with the new keyword.The new keyword means that creating an object or instantiating an object
List of interview questions:First, Javase common face questions1, Static and final difference? When you use the final keyword to decorate a variable,Is the reference immutable, or does the referenced object not change?2. What is the difference between "= =" and Equals method?3. What is the difference between a static variable and an instance variable?4, please say the scope public,private,protected, and do
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.