Nov

14

import java.io.*;
class FileTest{
public static void main(String ar[])throws IOException{
FileInputStream fis=new FileInputStream(“ab.txt”);
int i=fis.read();
while(i!=-1){
System.out.print((char)i);
i=fis.read();
}
}
}

//————————————————————–
import java.io.*;
class FileTest2{
public static void main(String ar[])throws IOException{
Console c=System.console();
String fname=c.readLine(“Enter File Name: “);
FileInputStream fis=new FileInputStream(fname);
int i=fis.read();
while(i!=-1){
System.out.print((char)i);
i=fis.read();
}
}
}
//—————————————————————-
import java.io.*;
class FileTest3{
public static void main(String ar[])throws IOException{
Console c=System.console();
String fname=c.readLine(“Enter File Name: “);
int j=fname.lastIndexOf(‘.’);
String s=fname.substring(j);
if(s.equalsIgnoreCase(“.c”)||s.equalsIgnoreCase(“.cpp”)||s.equalsIgnoreCase(“.java”)){
int o=0,k=0;
FileInputStream fis=new FileInputStream(fname);
int i=fis.read();
while(i!=-1){
if((char)i=='{‘)
o++;
if((char)i==’}’)
k++;
i=fis.read();
}
System.out.print(“{=”+o+” }=”+k);
}
else{
System.out.print(“Given File is not C/Cpp/java file”);
}
}
}
//——————————————————————
import java.io.*;
class FileTest3{
public static void main(String ar[])throws IOException{
Console c=System.console();
String fname=c.readLine(“Enter File Name: “);
int j=fname.lastIndexOf(‘.’);
String s=fname.substring(j);
if(s.equalsIgnoreCase(“.c”)||s.equalsIgnoreCase(“.cpp”)||s.equalsIgnoreCase(“.java”)){
int o=0,k=0;
FileInputStream fis=new FileInputStream(fname);
int i=fis.read();
while(i!=-1){
if((char)i=='{‘)
o++;
if((char)i==’}’)
k++;
i=fis.read();
}
System.out.print(“{=”+o+” }=”+k);
}
else{
System.out.print(“Given File is not C/Cpp/java file”);
}
}
}
//———————————————————————–
import java.io.*;
class FileTest5{
public static void main(String ar[])throws IOException{
Console c=System.console();
String fname=c.readLine(“Enter File Name: “);
FileInputStream fis=new FileInputStream(fname);
int i=fis.read();
while(i!=-1){
char ch=(char)i;
String st=ch+””;
st=st.toUpperCase();
System.out.print(st);
i=fis.read();
}
}
}
//—————————————————————–
import java.io.*;
class FileTest6{
public static void main(String ar[])throws IOException{
Console c=System.console();
String fname=c.readLine(“Enter From File Name: “);
String tname=c.readLine(“Enter To File Name: “);
FileInputStream fis=new FileInputStream(fname);
FileOutputStream fos=new FileOutputStream(tname);
int i=fis.read();
while(i!=-1){
fos.write(i);
i=fis.read();
}
}
}
//———————————————————————–

Oct

19

import java.io.*;
class Ex{
public static void main(String args[]){
Console c=System.console();
String snum1=c.readLine(“1st No: “);
String snum2=c.readLine(“2nd No: “);
try{
int n1=Integer.parseInt(snum1);
int n2=Integer.parseInt(snum2);
System.out.println(n1+n2);
System.out.println(n1-n2);
System.out.println(n1*n2);
System.out.println(n1/n2);
}
catch(ArithmeticException e){
System.out.println(e);
}
finally{
System.out.println(“Finally Called”);
}
System.out.println(“Exit from main”);
}
}

————————————————————————————–

import java.io.*;
class Ex1{
public static void main(String args[]){
Console c=System.console();
String snum1=c.readLine(“1st No: “);
String snum2=c.readLine(“2nd No: “);
try{
int n1=Integer.parseInt(snum1);
int n2=Integer.parseInt(snum2);
System.out.println(n1+n2);
System.out.println(n1-n2);
System.out.println(n1*n2);
System.out.println(n1/n2);
}
catch(Exception e){  // it will generate compile error
System.out.println(e);
}
catch(ArithmeticException e){
System.out.println(e);
}
catch(NullPointerException e){
System.out.println(e);
}

finally{
System.out.println(“Finally Called”);
}
System.out.println(“Exit from main”);
}
}

————————————————————————————-

import java.io.*;
class Ex2{
public static void main(String args[]){
Console c=System.console();
String snum1=c.readLine(“1st No: “);
String snum2=c.readLine(“2nd No: “);
int n1=Integer.parseInt(snum1);
int n2=Integer.parseInt(snum2);
if(n1<=5){
//throw new NumberFormatException(“Explict Thrown <=5”);
try{
throw new InterruptedException(“Explict Intruupt”);
}catch(InterruptedException i){
}
}
System.out.println(n1+n2);
}
}

——————————————————————————————-

import java.io.*;
class Ex3{
public static void main(String args[])throws InterruptedException{
Console c=System.console();
String snum1=c.readLine(“1st No: “);
String snum2=c.readLine(“2nd No: “);
int n1=Integer.parseInt(snum1);
int n2=Integer.parseInt(snum2);
if(n1<=5){
//throw new NumberFormatException(“Explict Thrown <=5”);
throw new InterruptedException(“Explict Intruupt”);
}
System.out.println(n1+n2);
}
}

——————————————————————————————————

import java.io.*;
class Ex4{
public static void main(String args[])throws MyExcep{
System.out.println(“Thows Exception”);
int i=0;
if(i==0)
throw new MyExcep(“This exception is created by programmer”);
System.out.println(“Exit from main”);
}
}
class MyExcep extends Exception{
MyExcep(String s){
super(s);
}
}

——————————————————————————————————-

import java.io.*;
class Ex5{
public static void main(String args[]){
System.out.println(“Thows Exception”);
int i=0;
try{
if(i==0)
throw new MyExcep(“This exception is created by programmer”);
}catch(MyExcep e){
}
System.out.println(“Exit from main”);
}
}
class MyExcep extends Exception{
MyExcep(String s){
super(s);
}
}

—————————————————————————————————-

import java.io.*;
class Ex6{
public static void main(String args[]){
System.out.println(“Thows Exception”);
Ex6 e6=new Ex6();
try{
e6.m1();
}catch(MyExcep e){
}
System.out.println(“Exit from main”);
}
void m1()throws MyExcep{
int i=0;
if(i==0)
throw new MyExcep(“This exception is created by programmer”);

}
}
class MyExcep extends Exception{
MyExcep(String s){
super(s);
}
}

————————————————————————————————————-

import java.io.*;
class Ex7{
public static void main(String args[]){
}
void m1()throws MyExcep{
}
void m2() throws Exception{
}
void m3() throws NumberFormatException{
}
}
class Ex extends Ex7{
void m1() throws NumberFormatException{
}
void m3()throws NumberFormatException,NullPointerException{
}
}
class MyExcep extends Exception{
MyExcep(String s){
super(s);
}
}

 

 

Oct

17

class TestString2{
public static void main(String args[]){
String s1=”ABC”;
String s2=new String(“ABC”);
String s3=”abc”;
String s4=” AB C “;
String s5=”abcabcabc”;
System.out.println(s1==s2);
System.out.println(s1.equals(s2));
System.out.println(s1.equals(s3));
System.out.println(s1.equalsIgnoreCase(s3));
System.out.println(s4.equalsIgnoreCase(s3));
System.out.println(s1.length());
System.out.println(s4.length());
System.out.println(s4.trim().length());
System.out.println(s3.toUpperCase());
//s3=s3.toUpperCase();
System.out.println(s3);
System.out.println(s1.toLowerCase());
System.out.println(s3.charAt(1));
System.out.println(s3.indexOf(‘b’));
System.out.println(s5.indexOf(‘b’));
System.out.println(s5.lastIndexOf(‘b’));
System.out.println(s5.indexOf(‘b’,5));
System.out.println(s5.indexOf(“ab”));
System.out.println(s5.indexOf(“ab”,3));
System.out.println(s5.lastIndexOf(‘a’,3));
System.out.println(s5.lastIndexOf(‘a’,2));
System.out.println(s5.lastIndexOf(‘a’,7));
}
}

——————————————————————————————

class TestString1{

public static void main(String args[]){
char ch[]={‘a’,’b’,’c’,’d’};
String s1=new String(“ABC”);
String s2=”ABC”;
String s3=new String(“ABC”);
String s4=new String(s3);
String s5=new String();
String s6=new String(ch);
System.out.println(s1+” “+s2+” “+s3+” “+s4+” “+s5+” “+s6);
if(s1==s2){
System.out.println(“SAME”);
}
else{
System.out.println(“NOT SAME”);
}
if(s1==s3){
System.out.println(“SAME”);
}
else{
System.out.println(“NOT SAME”);
}
}
}

——————————————————————————————————-

class T1{
public static void main(String arg[]){
String s1=”ABC”;
String s3=”ABC”;
String s2=new String(“ABC”);
String s4=new String(s2);
if(s1==s3){
System.out.println(“SAME”);
}
else{
System.out.println(“NOT SAME”);
}
if(s1==s2){
System.out.println(“SAME”);
}
else{
System.out.println(“NOT SAME”);
}
if(s2==s4){
System.out.println(“SAME”);
}
else{
System.out.println(“NOT SAME”);
}
if(s1.equals(s4)){
System.out.println(“SAME”);
}
else{
System.out.println(“NOT SAME”);
}
}
}

————————————————————————————————–

import java.io.*;

class StringTest1{
public static void main(String args[]){
Console c=System.console();
String st1=c.readLine();
String st2=st1.toUpperCase();
System.out.println(st2);
System.out.println(st1.toLowerCase());
System.out.println(“——————“);
for(int i=0;i<st1.length();i++){ System.out.println(st1.charAt(i)); } for(int i=st1.length()-1;i>=0;i–){
System.out.print(st1.charAt(i));
}
int ctr=0;
for(int i=0;i<st1.length();i++){
char ch=st1.charAt(i);
switch(ch){
case ‘a’:case ‘e’:case ‘i’:case ‘o’:case ‘u’:
case ‘A’:case ‘E’:case ‘I’:case ‘O’:case ‘U’:
System.out.print(“\n”+ch);
ctr++;
}
}
System.out.println(“\n”+ctr);
}
}

————————————————————————————————-

import java.io.*;

class StringTest2{
public static void main(String args[]){
Console c=System.console();
String st1=c.readLine();
System.out.println(st1.substring(3));//from 3rd index to length
System.out.println(st1.substring(3,5));// from 3rd index to 5-1index
}
}

—————————————————————————————————-

import java.io.*;

class StringTest3{
public static void main(String args[]){
Console c=System.console();
String st1=c.readLine(“Enter File Name”);
int i=st1.lastIndexOf(‘.’);
String s=st1.substring(i+1);
System.out.println(“File Type is ” + s);
}
}

Oct

09

Java Interface Examples

 

Filled Under: Java (Core)

Sep

23

Java Sample Code for observing File name, Class Name concept, Getting Input from console, main method etc.
Click to JAVA-1

Filled Under: Java (Core)

Sep

06

Aug

10

Campus Commune is a professional network rolled out by TCS for the academic community. It has been acknowledged and appreciated by the student community across India as an effective tool for collaboration. sharing, learning and exploration.

TCS Campus Commune has launched Code Vita (the biggest Coding Contest in India) on 22nd July,13. This contest shall be open to all the students( FY 14,15 and 16 and 17 batches) of your esteemed Institutions. Request you to kindly ask the students from FY 14,15,16 and 17 batch to subscribe to the portal. The process of launching Campus Commune has been attached below. Please share it with all the students at your Institute. The students registering on this portal from a TCS non accredited Institute are called Direct Candidates.

The contest will provide the candidates a competition platform on a national level to test their talents and they will witness a really enriching learning experience.

�The Registration and Team Formation process for Code Vita is open till 12th August,13.

The subscription to TCS Campus Commune is a prerequisite to register and participate in Code Vita. The subscription to Campus Commune is free of cost. Please see the attachment below which needs to be supplemented with the process of launching Campus Commune and sent across to the students.�

FOR MORE DETAILS CLICK THE FOLLOWING URLS:-

Codevita_Participation_Guidelines_For_Direct_Trainees

CodeVita_2013_Registration_and_Team_Formation

Jun

14

JDK1.6 DOWNLOAD

Jun

12

Software Developer Trainee

Eligibility : BE/B.Tech(CSE, IT), MCA

Location : Lucknow

Job Category : IT/Software, Walkin

Last Date : 16 Jun 2013

Job Type : Full Time

 

Hiring Process : Walk – In, Written-test, Face to Face Interview
Job Details

Eligibility Criteria :

Students from 2013 B.E/ B.Tech – (CS/IT)/ BCA/ MCA batch (if you are able to join instantly)

 

Job Responsibility :

This position is about creating web applications.
Working on products that are built on the SaaS model.
Exposure to Waterfall and Agile development methodologies.
Working on Open Source Products that are the largest Php/Mysql implementations in the world.
Will get the opportunity to do the mobile application development (Android as well as Iphone application)

 

Desired Profile :

Excellent problem solving and programming skills.
Very Good Technical skills.

Salary : INR 7000 per month on training period , After that INR 1.8 to 2.4 Lacs P.A

 

Job Location : Lucknow

Note : Selected candidates will have to sign a service agreement for one year. Results will be announced on Sunday (16th June 2013). Immediate Joining.

 

How to apply

Walk-in at the below mentioned venue on 15th & 16th June 2013 from 11AM to 4PM .

 

Venue :
CEDCOSS Technologies Private Limited
1/14 F Vishvash Khand Gomti Nagar , Lucknow
Uttar Pradesh -226010

 

Company Profile

CEDCOSS is a leading global Open Source software development company. We are dedicated to providing solutions to businesses by leveraging the power of open source software, solutions and technologies.

The Company has been promoted by highly experienced professionals dedicated to provide high quality IT solutions. We provide values to the product with applied quality process. We define, design and deliver IT solutions to our clients which help them to become front runner up in there domain. With CEDCOSS, clients are assured of a transparent business partner, world-class processes, speed of execution and the power to stretch their IT budget by leveraging the global delivery model that CEDCOSS pioneered.

We have severed more than 50 clients all over the globe(UK, Germany, Switzerland, USA) .

 

Mar

21

 #include <stdio.h>
 #include <string.h>
 
 void main() {
 char *name=(char*)malloc(sizeof(50));
scanf(“%s”,name);
 printf(“\nMy name is %s\r\n”,name) ;

 }

Mar

16

Click to Download Sample Code Day-5

Mar

12

Clcik Here to Download

Filled Under: Workshops

Mar

09

School of Management Sciences, Varanasi with Waayoo.com will organize a workshop on “Web Application Development(RIA)” using Java Technology for MCA Students to match the present web development requirements. This workshop will cover all the advanced java technology topics like GWT, Spring, Hibernet, MVC etc. from 11.03.2013 to 16.03.2013.

SMS VARANASI WORKSHOP

 

 

 

For the complete content details of the workshop click here:-

Workshop Content Details

 

Prerequisite to do this workshop: Participants are adviced to develop some java programs using Eclipse IDE and revise JAVA OOPs concepts