Addition of Two String
Program Info
Program Code
×

Addition of Two String

We are doing add two strings.

Footer

×

Addition of Two String

public class addition_of_two_string_value 
{
  public static void main(String[] args) 
  {
    String firstName = "John ";
    String lastName = "Doe";
    String fullName = firstName + lastName;
    System.out.println(fullName);  
  }
}

Footer

Addition of Two Integer Numbers
Program Info
Program Code
×

Addition of Two Integer Numbers

We are doing add two integer numbers and print result.

Footer

×

Addition of Two Integer Numbers

public class addition_of_two_int_value 
{
  public static void main(String[] args) 
  {
    int x = 5;
    int y = 6;
    System.out.println(x + y); // Print the value of x + y
  }
}

Footer

Calling Interface Method
Program Info
Program Code
×

Calling Interface Method

We are calling an interface method that does not have an body.

Footer

×

Calling Interface Method

interface Animal 
{
  public void animalSound(); // interface method (does not have a body)
  public void sleep(); // interface method (does not have a body)
}

class Pig implements Animal 
{
  public void animalSound() 
  {
    System.out.println("The pig says: wee wee");
  }
  public void sleep() 
  {
    System.out.println("Zzz");
  }
}

class call_interface_method_which_does_not_have_a_body 
{
  public static void main(String[] args) 
  {
    Pig myPig = new Pig();
    myPig.animalSound();
    myPig.sleep();
  }
}

Footer

Casting Integer Data to Double
Program Info
Program Code
×

Casting Integer Data to Double

We are doing cast an integer data to double and print them.

Footer

×

Casting Integer Data to Double

public class Automatic_casting_int_to_double 
{
  public static void main(String[] args) 
  {
    int myInt = 9;
    double myDouble = myInt; // Automatic casting: int to double

    System.out.println(myInt);
    System.out.println(myDouble);
  }
}

Footer

Modify Value Through Call a Method of Class
Program Info
Program Code
×

Modify Value Through Call a Method of Class

We are doing modify value through call a method of class.

Footer

×

Modify Value Through Call a Method of Class

class A
{
	int x;
	void f1()
	{
		int y=5;
		 x=y;
	}
}
class call_f1_method_through_object_of_class_A_and_print_some_value_of_object2
{
   public static void main(String[] aa)
   {
	   A a=new A();
	   a.f1();
	   System.out.println(a.x);
   }
}

Footer

Print Sum of Numbers Though Call Method
Program Info
Program Code
×

Print Sum of Numbers Though Call Method

We are doing print sum of numbers though call a method.

Footer

×

Print Sum of Numbers Though Call Method

public class before_call_and_print_myMethod_parameterised_function_using_return 
{
  static int myMethod(int x, int y) 
  {
    return x + y;
  }

  public static void main(String[] args) 
  {
    int z = myMethod(5, 3);
    System.out.println(z);
  }
}

Footer


×

Name : Krishna Verma    |    Father's Name : Mr. Satish Kumar    |    Email ID : krishnaverma28081997@gmail.com    |    Religion : Hindu    |    Address : Dayampur, kanker khera, Meerut Cantt (250001), UP    |    Date of Birth : 28 August 1997    |    Marital Status : Non-Married    |    Place of Birth : Dayampur Kanker Khera Meerut Cantt.    |    Gender : Male    |    Age : 28    |    Contact : 9520335394    |    Father's Occupation : Sports man    |    Mother's Name : Smt. Kuntesh Devi    |    Mother's Occupation : Homemaker    |    Number of Brothers : 1    |    Number of Sisters : 1    |    Current Residence : Dayampur kanker khera meerut cantt    |    Family Type : Nuclear Family    |    Family Name : verma    |    Height : 5' 6''    |    Weight : 70 kg    |    Complexion : Fair    |    Body Type : Athletic    |    Hair Color : Black    |    Health Status : Good    |    Any Physical Disability : No    |    Highest Qualification : B.Tech (CSE)    |    Master Skill : PHP Laravel    |    Total Projects : 40 +    |    Total Skills : 25 +    |    Languages Known : Hindi and English    |    Website : krishnaportfolio.in    |    Siblings : 3    |    Nationality : Indian    |    Total Experience : 5 Years    |    LinkedIn : https://www.linkedin.com/in/krishna-verma-840b71356/    |    Total Programs : 10000    |    Total Projects : 40    |    Total Skills : 25    |    Total Experience : 5    |    Total DSA Problems : 165    |    Total Served Companies : 2