1.
class MyDemo
{
static int iCount=0;
MyDemo()
{
iCount++;
}
public static void disp()
{
System.
out.
println(iCount);
}
public static void main(String args[])
{
MyDemo obj1 = new MyDemo();
MyDemo obj2 = new MyDemo();
obj1.
disp();
}
}
what is o/p?
2....
More
1.
class MyDemo
{
static int iCount=0;
MyDemo()
{
iCount++;
}
public static void disp()
{
System.
out.
println(iCount);
}
public static void main(String args[])
{
MyDemo obj1 = new MyDemo();
MyDemo obj2 = new MyDemo();
obj1.
disp();
}
}
what is o/p?
2.
Consider the following code:
interface MyInterface
{
int PI=3.
414;
void draw();
void setColor()
{
System.
out.
println("Color it red");
}
}
what is o/p?
3.
consider the following statements are written at command prompt
java myprog good morning
public class myprog{
public static void main(String argv[])
{
System.
out.
println(argv[2]);
}
}
what is o/p?
4.
class base
{
Less