T4494762.java revision 0
577N/A/*
577N/A * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
577N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
577N/A *
1072N/A * This code is free software; you can redistribute it and/or modify it
577N/A * under the terms of the GNU General Public License version 2 only, as
577N/A * published by the Free Software Foundation.
919N/A *
919N/A * This code is distributed in the hope that it will be useful, but WITHOUT
919N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
919N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
919N/A * version 2 for more details (a copy is included in the LICENSE file that
919N/A * accompanied this code).
919N/A *
919N/A * You should have received a copy of the GNU General Public License version
919N/A * 2 along with this work; if not, write to the Free Software Foundation,
919N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
919N/A *
919N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
919N/A * CA 95054 USA or visit www.sun.com if you need additional information or
919N/A * have any questions.
919N/A */
919N/A
919N/A/*
577N/A * @test
577N/A * @bug 4494762 6491939
577N/A * @summary Request for Clarification of JLS 15.12.2.2
577N/A * @author Peter von der Ah\u00e9
577N/A * @compile T4494762.java
577N/A */
1072N/A
577N/Apublic class T4494762 {
911N/A
1072N/A static class Homer {
1072N/A float doh(float f) {
911N/A System.out.println("doh(float)");
577N/A return 1.0f;
606N/A }
829N/A
829N/A char doh(char c) {
1099N/A System.out.println("doh(string)");
1099N/A return 'd';
577N/A }
577N/A }
577N/A
577N/A static class Bart extends Homer {
577N/A float doh(float f) {
577N/A System.out.println("doh(float)");
577N/A return 1.0f;
577N/A }
970N/A }
970N/A
970N/A public static void main(String[] args) {
970N/A Bart b = new Bart();
970N/A b.doh('x');//compiler error in this line
970N/A b.doh(1);
970N/A b.doh(1.0f);
970N/A }
970N/A}
970N/A