I have uploaded all my projects in C, C++, HTML, CSS, Java, and Android Development Projects in a topic-wise sequential manner.
Further posts are uploaded on https://mohitx001.blogspot.com/
package com.company ; public class Ch7_32_MethodOverloading { static void greet () { // no return type (void) with no parameters System . out . println ( "Hello, Nice to meet you" ); } static void add ( int x , int y ) { // void return with parameter x and y int z = x + y ; System . out . println ( "The addition of " + x + " and " + y + " is: " + z ); } static void func () { System . out . println ( "The function has no value in it." ); } static void func ( int x ) { System . out . println ( "The value in the function is : " + x ); } static void func ( int x , int y ) { System . out . println ( "The value in the function is : " + x + " " + y ); } static void func ( int x , int y , int x1 ) { System . out . println ( "The value in the function is : " + x + " " + y + " " + x1 ); ...
package com.company.Ch6_29_PracticeSet ; import java.util.Scanner ; public class PS_Ch6_Q4 { public static void main ( String [] args ) { Scanner scan = new Scanner ( System . in ); int [][] matrix1 = new int [ 2 ][ 3 ]; int [][] matrix2 = new int [ 2 ][ 3 ]; int [][] sum = new int [ 2 ][ 3 ]; System . out . println ( "Enter the elements for matrix 1" ); for ( int i = 0 ; i < matrix1 . length ; i ++) { for ( int j = 0 ; j < matrix1 [ i ]. length ; j ++) { System . out . print ( "Enter the element for R" + ( i + 1 ) + "C" + ( j + 1 ) + " : " ); matrix1 [ i ][ j ] = scan . nextInt (); } } System . out . println ( "Enter the elements for matrix 2" ); for ( int i = 0 ; i < matrix2 . length ; i ++) { for ( int j = 0 ; j < matrix2 [ i ]. length ; j ++) { System . out . pr...
package com.company ; import java.util.Scanner ; public class Ch3_13_Strings { public static void main ( String [] args ) { String str ; str = new String ( "Hello Harry" ); System . out . println ( str ); String name = "Harry" ; System . out . println ( name ); Scanner scan = new Scanner ( System . in ); String S = scan . next (); //Scans a String from user input System . out . println ( S ); System . out . print ( "No new line here." ); System . out . println ( "New line" ); int a = 10 ; float b = 12.21f ; System . out . printf ( "The value of a is %d and b is %f. \n " , a , b ); System . out . format ( "The value of b is %.2f and a is %d." , b , a ); } }
Comments
Post a Comment