class Tloop{
public static void main(String [] args)
{
int I=0;
outer:while(true)
{
I++;
inner:for(int j=0;j<10;j++)
{
I+=j;
if(j==3)
continue inner;
break outer;
}
continue outer;
}
System.out.println("I is "+I);
}
}
/*********************************/
class SuperServer{
public SuperServer()
{
System.out.println("all");
}
public SuperServer(int y)
{
this();
System.out.println("good");
}
}
class TestServer extends SuperServer{
public TestServer(int y){
System.out.println("Things");
}
public TestServer(){
super(10);
System.out.println("come");
}
public static void main(String[]args)
{
TestServer ts =new TestServer(10);
}
}
/****************************/
class Test{
protected void start() throws Exception{
}
}
class Child extends Test{
public void start() throws ClassCastException{
}
}
/************************/
abstract class Bass{
private void one(){}
abstract public void two();
abstract public void three();
abstract protected void four();
}
public class Q10{
public static void main(String[]args)
{}
}
/******************************/
class Base{
void one(int i)
{
}
public void two(int i){}
protected static void three(int i){}
public static void four(int i){}
}
class Derived extends Base{
protected void one(int i){}
public void two (int i){}
static protected void three(int i){}
public static void four(int i){}
}
public class Q08
{
public static void main(String[]args)
{
Base a=new Derived();
}
}
/***************************/
public class Q04
{
public static void main(String[]args)
{
int i=10;
Integer I=0;
Object [] objArr=new Object[1];
Object o=objArr[0];
objArr[0]=i;
objArr[0]=I;
objArr[0]=new Float(String.valueOf(i));
}
}
/**************************/
class When
{
public static int i;
public static float f;
public When(){}
static{
i=10;
f=10.0f;
}
public static String sayHello(){
return "Hello";
}
}
public class Q03
{
public static void main(String [] args){
System.out.println("Start of program");
System.out.println("Before Declaring when Object");
When when;
System.out.println("Before accessing a static method");
System.out.println(When.sayHello());
System.out.println("Before accssisng a ststic field");
System.out.println(When.i);
}
}
/************************/
class Holder{
static int i=0;
public Holder(){i++;}
public static int getCount(){return i;}}
public class Q02{
private Holder holder;
public Holder getHolder(){
return holder;}
public static void main(String[]args){
Q02 q02=new Q02();
Holder holder= q02.getHolder();
System.out.println(holder.getCount());
}
}
/***************************/
public class Q01{
public int f(){int i=0;
return ++i;}
public static void main(String []args)
{
Q01 q01 = new Q01();
System.out.println(q01.f());}}
/**************************/
interface Eatable{}
class Vegetables extends Food implements Eatable{}
class Food{}
class Meat extends Food implements Eatable{}
class GreenPeas extends Vegetables{
public Eatable getSomething()
{
return new GreenPeas();
}
}
/***************************/
interface Contents{
int value();
}
class Parcel33{
private class PContents implements Contents{
private int i = 11;
public int value(){return i;}
}
public Contents cont(){
return new PContents();
}
}
public class Parcel3{
public static void main(String[]args)
{
Parcel33 p = new Parcel33();
Contents c = p.cont();
// Parcel33.PContents pc = p.new PContents();
System.out.println(c.value());
}
}
/*****************************/
public class Leaf{
int i=3;
Leaf increment()
{
i++;
return this;
}
void print()
{
System.out.println("I = "+i);
}
public static void main(String[]args)
{
Leaf x=new Leaf();
x.increment().increment().increment().print();
}
}
/***************************/
class Holder{
static int i=0;
public Holder(){i++;}
public static int getCount(){return i;}}
public class Q02{
private Holder holder;
public Holder getHolder(){
return holder;}
public static void main(String[]args){
Q02 q02=new Q02();
Holder holder=q02.getHolder();
System.out.println(holder.getCount());
}
}
/*****************************/
import java.util.Iterator;
class Foo{
private class Bar{
protected Bar()
{
System.out.println("Foo.Bar");
}
}
private Bar b;
Foo(){
System.out.println("Foo");
b=this.new Bar();
}
}
class FooToo extends Foo{
private class Bar{
protected Bar(){
System.out.println("FooToo.Bar");
}
}
public static void main(String[]args)
{
new FooToo();
FooToo s=new FooToo();
s.new Bar();
}
}
/********************************/
import java.util.Iterator;
public class Foo{
protected class Bar{
protected Bar()
{
System.out.println("Foo.Bar");
}
}
private Bar b;
Foo(){
System.out.println("Foo");
b=this.new Bar();
}
}
class FooToo extends Foo{
protected class Bar{
protected Bar(){
System.out.println("FooToo.Bar");
}
}
public static void main(String[]args)
{
new FooToo();
}
}
/*****************************/
import java.awt.Button;
class BB{
public static void main(String[]args)
{
Button a =new Button("Exit");
Button b=new Button("Exit");
Button c=a;
System.out.println((a==b)+" "+(a==c));
}
}
/***************************/
class Cup{
Cup(int m)
{
System.out.println("Cup = " + m);
}
void f(int m){
System.out.println("f = "+m);
}
}
class Cups{
static Cup c1;
static Cup c2;
static{
c1=new Cup(1);
c2=new Cup(2);
}
Cups(){
System.out.println("Cups()");
}
}
public class BM{
public static void main(String [] args)
{
System.out.println("InsideMain");
Cups.c1.f(99);
}
//static Cups x=new Cups();
static Cups y=new Cups();
}
/******************************/
public class Parcel5{
private void internalTracking(boolean b)
{
if(b)
{
class TrackingSlip{
private String id;
TrackingSlip(String s)
{
id=s;
}
String getSlip(){return id;}
}
TrackingSlip ts=new TrackingSlip("x");
String s =ts.getSlip();
System.out.println(s);
}
// TrackingSlip ts = new TrackingSlip("slip");
}
public void track(){internalTracking(true);}
public static void main(String[]args)
{
Parcel5 p = new Parcel5();
p.track();
}
}
/*************************************/
class A {
int i;
public String toString()
{
return "KOKO";
}
}
public class BM
{
public BM()
{
System.out.println("safi");
}
static void print (Object [] x)
{
for(int i=0; i<x.length;i++)
System.out.println(x[i]);
}
public String toString()
{
return "----@----";
}
public static void main(String [] args)
{
print(new Object[]{"one","Two","Three"});
print(new Object[]{
new Integer(47),new BM(),
new Float(3.14),new Double(11.11)});
Object[]b=new Object[]{new Integer(1),new Character( 'z' ),new A()};
print (b);
}
}
/****************************/
class Insect{
private int i=9;
protected int j;
Insect()
{
System.out.println("i= "+i+"j = "+j);
j=39;
}
private static int x1 = print("insect.x1");
static int print(String s)
{
System.out.println(s);
return 47;
}
}
public class Beetle extends Insect {
private int k=print("Beetle.k");
public Beetle()
{
System.out.println("k = "+k);
System.out.println("j = "+j);}
private static int x2=print("Beetle.x2");
public static void main(String [] args)
{
System.out.println("BeetleConstructor");
Beetle b=new Beetle();
}
}
/***********************/
public class aa{
private static boolean test;
public static void showTest()
{
System.out.println(test);
}
public static void main(String[]args)
{
new a().showTest();
}
}
/****************************/
ادعولنا............