Posts

Showing posts from May, 2015

Basic Java learning - Ignou MCA students

Session 4  ex 2 class players { String name,age; } class cricket_players extends players {     void get_data(String n,int age)     {         System.out.println("Name : "+n + "Age "+age);     } } class football_players extends players {     void get_data(String n,int age)     {         System.out.println("Name : "+n + "Age "+age);     } } class hockey_players extends players {     void get_data(String n,int age)     {         System.out.println("Name : "+n + "Age "+age);     } } class ketan {     public static void main(String args[])     {         cricket_players c=new cricket_players();         football_players f=new football_players();         hockey_players h=new hockey_players();                 c.get_data("ABC",25);         f.get_data("ABCD",28);         h.get_data("ABCE",35);     } } ================================================================== session 4 ex-3 class worker { Stri

Java tutorial - Ignou MCA students

SEM - 2     JAVA SESSION1_EX1 /*  * To change this template, choose Tools | Templates  * and open the template in the editor.  */ package mcs025; /**  *  * @author KETAN  */ public class SESSION1_EX1 {         public static void main(String args[])     {         int height=10,width=20,area;         area=height * width;         System.out.println("The area of ranctangle is " +area);             }     }      =====================================================================                     session1_ex4 /*  * To change this template, choose Tools | Templates  * and open the template in the editor.  */ package mcs025; /**  *  * @author KETAN  */ public class session1_ex4 {         public static void main(String args[])     {         int marks=616,sub=7,avg;         avg=marks / sub;         System.out.println( "The average marks is "+avg);             }     } =============================================================== session2_ex1 /*  * To change