public static void main(String arg...){
.......
}
arg in main function shows.
class mp{
mp(){
System.out.println("hi");
}
mp(float x){
System.out.println("hello");
}}
class sp{
public static void main(String ard[]){
mp obj=new mp(12.89);
}}
what will be the output?
class mp{
mp(){
mp obj=new mp();
System.out.println("india");
}
void fun(){
System.out.println("great");
}}
class sp{
public static void main(String arg[]){
new mp().fun();
}}
class mp{
int x;
void fun(){
x=20;
}}
class sp{
public static void main(String arg[]){
System.out.println(mp.x);
}}
class mp{
int x=50;
mp(){
x=100;
}
void fun(){
x=200;
}}
class sp{
public static void main(String arg...){
int y=mp.x;
int x=new mp();
int z=new mp().fun();
System.out.println("y="+y+"x="+x+"z="+z+);
}}