fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. { public class A{
  10. int a; char b;
  11. public A(int x, char y ){
  12.  
  13. a=x; b=y;
  14. }
  15. public void print() {
  16. System.out.println("Print function called") ;
  17. }
  18. public A(){
  19.  
  20. }
  21.  
  22. }
  23.  
  24. public interface B{
  25. void unfriend();
  26. }
  27. static public class C extends A implements B{
  28. char d;
  29. public C(int x, char y, char z){
  30. super(x,y);
  31. //this->d=z;
  32. d=z;
  33. }
  34. public C(){
  35.  
  36. }
  37. @Override
  38. public void unfriend(){
  39. System.out.println("unfriended");
  40. }
  41.  
  42. }
  43.  
  44. public static void main (String[] args) throws java.lang.Exception
  45. { C s=new C(2,'a','b');
  46. //C s =new C(); //error line
  47.  
  48. s.unfriend();
  49. // your code goes here
  50. }
  51. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:30: error: no enclosing instance of type Ideone is in scope
		super(x,y);
		^
stdout
Standard output is empty