Join Regular Classroom : Visit ClassroomTech

Delloite Question Solve | Part 1 | Codewindow.in

public class Demo 
{ 
	public ststic void main(String args[])
	{
		int variable1 = 2;
		int variable2 = 3;
		for(int counter=1; counter<10 & variable1>1; counter++)
		{
			if(counter % 2 == 0)
			{
				System.out.print(counter);
			}
			else
			{
				variable1++;
				System.out.print(variable1);
			}
		}
	}
}
class A{
	public int foo;
}
public class B extends A{
	public int bar;
	public void setBar(int b){
		bar = b;
	}
}
public class TestDivide
{
	public static void main(String args[])
	{
		int value = 0;
		try{
			int result = 10value;
		}finally{
			System.out.println("f");
		}
	}
}

C QA

Mostly Asked

DS QA

Mostly Asked

DBMS QA

Mostly Asked

ML QA

Mostly Asked

class ParentClass{
	public int doStuff(int x){
		return x*2;
	}
}
public class ChildClass extends ParentClass{
	public static void main(String args[]){
		ChildClass cc = new ChildClass();
		long x = cc.doStuff(7);
		System.out.println("x= " + x);
	}
	public long doStuff(int x){
		return x*3;
	}
}
public class TestArray
{
	public static void main(String args[])
	{
		int array[][] = new int[2][2];
		for(int m=0; m<2; m++)
			for(int n=0; n<2; n++)
				if(m == n) array[m][n] = 1;
				else array[m][n] = 0;
		for(int m=0; m<2; m++){
			for(int n=0; n<2; n++){
				System.out.print(array[m][n]);
			}
		}
	}
}
public interface HeavenlyBody { Sting describe(); }

class Star implements HeavenlyBody {
	String starName;
	public String describe() { return "star" + starName; }
}

class Planet {
	String name;
	Star orbiting;
	public String describe() {
		return "planet " + name + "orbiting " +orbiting.describe();
	}
}
abstract class Myclass {
	void int() {}
	abstract int calculate();
}
class MyImpl extends Myclass {
	int calculate() {
		System.out.println("Invoking calculate...");
		return 1;
	}
}
public class TestMyImpl {
	public static void main(String[] args) {
		MyImpl ml = new MyImpl();
		ml.init();
		ml.calculate();
	}
}
Class Test{
	static boolean b1;
	public static void main(String[] args){
		boolean[] array = new boolean[1];
		boolean br = true;
		System.out.print(b1+",");
		System.out.print(array[0]+",");
		System.out.print(b2);
	}
}

Also Checkout

Recent Posts
Categories
Pages