Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  MethodCall.java

  Sprache: JAVA
 

/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


/**
 * Try different kinds of method calls.
 */

public class MethodCall extends MethodCallBase {
    MethodCall() {
        super();
        System.out.println("  MethodCall ctor");
    }

    /* overridden method */
    int tryThing() {
        int val = super.tryThing();
        Main.assertTrue(val == 7);
        return val;
    }

    /* do-nothing private instance method */
    private void directly() {}

    /*
     * Function with many arguments.
     */

    static void manyArgs(int a0, long a1, int a2, long a3, int a4, long a5,
        int a6, int a7, double a8, float a9, double a10, short a11, int a12,
        char a13, int a14, int a15, byte a16, boolean a17, int a18, int a19,
        long a20, long a21, int a22, int a23, int a24, int a25, int a26,
        String[][] a27, String[] a28, String a29)
    {
        System.out.println("MethodCalls.manyArgs");
        Main.assertTrue(a0 == 0);
        Main.assertTrue(a9 > 8.99 && a9 < 9.01);
        Main.assertTrue(a16 == -16);
        Main.assertTrue(a25 == 25);
        Main.assertTrue(a29.equals("twenty nine"));
    }

    public static void run() {
        MethodCall inst = new MethodCall();

        MethodCallBase base = inst;
        base.tryThing();
        inst.tryThing();

        inst = null;
        try {
            inst.directly();
            Main.assertTrue(false);
        } catch (NullPointerException npe) {
            // good
        }

        manyArgs(01L, 23L, 45L, 678.09.0f, 10.0, (short)1112,
            (char)131415, (byte)-16true181920L, 21L, 222324,
            2526nullnull"twenty nine");
    }
}

class MethodCallBase {
    MethodCallBase() {
        System.out.println("  MethodCallBase ctor");
    }

    int tryThing() {
        return 7;
    }
}

Messung V0.5 in Prozent
C=86 H=96 G=90

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-29) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik