• stringtokenizer

    StringTokenizer : Util Package

    What is use of Stringtokenizer in Java Program?   Program on Stringtokenizer import java.util.*; class util1 { public static void main(String args[]) { String str = “name=Mr.Dixit;” +”Address=sector-23;” +”age=21;”; StringTokenizer s1 = new StringTokenizer(str, “=;”); while(s1.hasMoreTokens()) { String key = s1.nextToken(); String val = s1.nextToken(); System.out.println(key + ” : ” + val); } } }

  • Method overloading in Cpp Program

    Method Overloading : Cpp Program : 7

    Method Overloading in Cpp Programs What is Method Overloading ? When we use same name methods in one class with different parameters this is called method overloading in Cpp Programs. More details on this topic. In this program, area(int r) and area(int l,int h) are same name method, these two methods store at the same location […]

  • friend function in cpp programs

    Friend Function : Cpp Program : 6

    Friend Function in Cpp Program In this blog, we will see how to make different between normal function and friend function in cpp programming language. Friend Function in Class : No Need any object for calling. – Check fun1() in program Normal Function in Class : Must Need object for calling. – Check fun2() in […]

  • default argument

    Default Argument : Cpp Program : 5

    Default Argument with const argument in Cpp Program In this blog, we will see default argument and const argument in cpp program. Program #include<iostream.h> #include<conio.h> class Example { public: void setData(int x,int y=30,int z=10) { cout << “Sum = ” << (x+y+z); cout << endl; } void setData1(const int x=30) { // x++; // can […]