new class name method name v whb b what does it mean

Updated on educate 2024-02-09
29 answers
  1. Anonymous users2024-02-05

    new, call the answer method under this function, and the arguments required in it are v, whb, b

    For example, beibao as a specific example, it can be written as beibao beibao = new beibao();

    whb,b);

    I can't help it if I don't understand.

  2. Anonymous users2024-02-04

    beibao().answer(v,whb,b);

    Meaning, call the method answer(v,whb,b) in the beibao() class, where.

    v, whb, b), which should be the arguments that need to be passed in the method answer that is called;

  3. Anonymous users2024-02-03

    thread t1=new thread(srt);What this means is to create a thread t1 whose arguments are the does-like object str that implements the runnable interface that you can pass; to start thread t1

    By all means.

  4. Anonymous users2024-02-02

    Call the answer method in the beibao class and pass the argument to the answer method, if you don't understand, you can continue to ask.

  5. Anonymous users2024-02-01

    The class can only be static, decorated with static, otherwise it needs to be a new class object.

  6. Anonymous users2024-01-31

    Static methods are called by class name.

  7. Anonymous users2024-01-30

    1. new class name ();

    Once you have defined the class name, define the desired method in the class.

    2. Shouldn't the MouseListener interface be implemented for listening to mouse events? How is the mouseadapter in example (2) above?

    The mouseAdapter implements the MouseListener interface, and if you want to implement the MouseListener directly, you must implement the 5 methods of the interface (MouseClicked, MouseEntered, MouseExited, MousePressed, MouseReleased). But here you only want to implement one of the methods, mousereleased, so you can use the mouseadapter class that implements the mouselistener interface, so that you can only write the method you want to use, and don't worry about the other methods.

  8. Anonymous users2024-01-29

    new class name(); is corresponding to an inner class.

    The mouseadapter accident addmouselistener call parameter.

  9. Anonymous users2024-01-28

    jpanel to see if this is an interface or something, if you only use it once, you can write it like this. It is not commonly used to write like this.

  10. Anonymous users2024-01-27

    If the class name is a method that is called directly, then this method is a static method, and it is a method that can be called directly without creating a new object instance. Examples are as follows:

    class a{

    public static void method1(int a, int b){

    Method body. The naming of class names is particular, class names, attribute names, and variable names are generally nouns, or adjectives + nouns.

    The method is generally a verb, or a verb + noun, there is a difference between using annotationtest as the class name and testannotation as the class name, the former is a test of annotations, which conforms to the characteristics of nouns, and the latter is a test annotation, which sounds like an action name and is the naming feature of the method.

  11. Anonymous users2024-01-26

    Arguments to the name of the method!! For example, this class has a method like sayhello(string name,string contents), and the last call is new hello()sayhello("Name","Contents");

  12. Anonymous users2024-01-25

    The method name should be written as the argument of the method, and you can look at the overload and override properties when you have time.

  13. Anonymous users2024-01-24

    The name of the method is written in the passed parameters, pass the parameters you need into it, and process it in the next method.

    class a

    class b}

  14. Anonymous users2024-01-23

    new a(){ is an anonymous inner class.

    Represents a subclass of a without a class name, and the b() inside the curly brackets can be a newly defined method or a method that rewrites a class.

  15. Anonymous users2024-01-22

    Instance an object A of class A, and implement a method B in A, because A may be an abstract class and B is one of the abstract methods, so you must implement an abstract method when you need to instantiate an abstract class. Of course, it may also be other cases, it depends on the whole **.

  16. Anonymous users2024-01-21

    a a=new a();

    This is instantiating an object a; But new a()} really hasn't come across it. You read it wrong.

  17. Anonymous users2024-01-20

    Isn't this an anonymous inner class?

  18. Anonymous users2024-01-19

    new a() is an anonymous built-in subclass of class a, and your function b() is incorrectly defined (no return value).

  19. Anonymous users2024-01-18

    new means to create an instance, aa

    newb(), which is to point A (reference) to instance B, i.e., up (parent) transformation.

  20. Anonymous users2024-01-17

    When declaring object a, execute the function body, i.e., the b(){ method!} I'm not sure.

  21. Anonymous users2024-01-16

    You post the full ** out and take a look.

  22. Anonymous users2024-01-15

    The former is in Shendu, Zhanbai District

    Please. The latter is to apply for zhi in the stack area. (The latter should be the * object name = new class name (parameter)) in the dao class name).

    For example, two objects can be contained in the function fun.

    fun() When the function fun is executed, A will automatically call the destructor of the base to end its life.

    And the object to which B points does not end its own life. You have to manually call delete b, and if you use the new application, remember to write delete otherwise it will cause a memory leak (although the applet may not care about this leak).

  23. Anonymous users2024-01-14

    1. Class Name Object Name (Parameter.

    An object (in static memory) is defined

    2. Class name * object name = new class name (parameter); Request a space in dynamic memory, fill in the necessary parameters in this space, and then return the address of the object to the pointer of the object name. Keep in mind that the space you're requesting needs to be explicitly freed.

  24. Anonymous users2024-01-13

    One is in Stack and one is in Heap

  25. Anonymous users2024-01-12

    Suppose the main class is A, which declares the object of class B, then the private static class object name, the private modifier means that the outside is inaccessible, and the static class means the static member, which can be used inside the main class and all objects of this class share a B object, i.e. B in all A objects changes no matter where B is modified.

    class object=new class_name(); This means that each A object contains a unique and independent B object, and the modification will not affect the other A objects.

    The name of the object. The difference with the method name () is that if the method changes the internal member of B, then the static method ensures that the other objects of A are changed, otherwise only the B object of the method is currently called.

  26. Anonymous users2024-01-11

    The first thing to understand is what static does.

    Classes that are statically decorated with fields and segments will be executed during compilation of private static user user; For static variables, there is only one copy in memory (memory saving), which means that it doesn't matter how many objects you create in **. It's all about this object.

    Object=new class name () for normal objects

    Different He will create multiple objects user user1 = new user(); user user2 = new user();

    Here user1 and user2 occupy two different addresses in memory, which are two different objects.

  27. Anonymous users2024-01-10

    private static class object name; The established object is static, i.e. it will exist for as long as the program is running.

    The class object = new class name() so that the resulting object is dynamic, and when it is out of the scope of the object, the object will be gc

  28. Anonymous users2024-01-09

    The object declared static is a static object that is shared by all objects of the current class, for example.

    class b

    class a

    All objects of A share a B, but each object has a private C

  29. Anonymous users2024-01-08

    c How to do it without overloading.

    If you look closely, sometimes you use the new keyword, sometimes you have a parameter after the type, you have multiple arguments, or you don't have a argument, you just call a different constructor to instantiate the object...

Related questions
4 answers2024-02-09

Earth, Earth, Fire) implies that health and life are going well >>>More