This page has the following sub pages.
Archives
Categories
- About Me
- Adobe
- Adobe Acrobat
- Animation
- Anna Nicole Smith
- Architecture
- Asha Bosle
- backdoor
- Big Data
- Bindi Irwin
- Blogging in general
- Brad Pitt
- Britney Spears
- Cars
- Christianity
- Common Architecture
- Cricket
- Crocodile Hunter
- CSS
- Da Vinci Code
- Daylight Saving Time
- DB2
- Deals
- Digg
- Diwali
- Email Forwards
- Entertainment
- Equity
- Festivals & Events
- Finance
- Firefox
- French
- Funny Moments
- Games
- GizmoCall
- Global Warming
- Gmail
- Gmail Tools
- Google Map
- Google Office
- Google Reader
- H1B
- hacking
- Harry Potter
- Historical Places
- HIV
- HowTo
- HTML
- ICC Trophy
- India
- Info for the Day
- Innovation
- Interview Q & A
- iPhone
- ipod
- Islam
- J2EE
- J2SE 5
- James Bond
- Java
- Java Q & A
- Javascript
- JDBC
- Jobs
- Jokes
- JSP
- Love Story
- Mac Vs PC
- MacBookPro
- Microsoft
- Miss World
- Mission Impossible
- Mona Lisa
- Movies
- Mozilla Firefox
- My Car
- My Diary
- News
- Odeo
- Office
- Online Softwares
- OOPS Concept
- Open-Source
- Opera
- Photographs
- Photography
- Pirates of the Caribbean
- Poll
- Rajini
- Religious
- Saddam Hussein
- Security
- Servlets
- Sex
- Shakira
- Shivaji
- Short Stories
- Sidney Sheldon
- Snow
- Softwares
- SplashCast
- Steve Irwin
- STRUTS
- Tamil
- Technical
- Terri Irwin
- Tips & Tricks
- Tom Cruise
- Toyota Rush
- Trading
- Travel
- Tribute
- Two Tier
- Ubuntu
- Uncategorized
- US Visa
- USA
- Utilities
- Vacation
- Valentines Day
- Videos
- Vista
- Warner
- Web 2.0
- Webdesign
- Wedding
- Wedding Photography
- Windows Media Player
- WinXP Tips
- Yahoo
- Yahoo Pipes
- youtube
- zoho
- zune
Subscriptions…
Blog Stats
- 7,684,238 hits so far...
Java
OOP Concepts
Now Showing
-
Recent Posts
Top Posts
My Album
Extras..
My blog is worth $149,603.10.
How much is your blog worth?Disclaimer
The information on this site is for informational purposes only. My quotations within this Blog are intended to be used under a policy of personal and non commercial use. The use of any Trademark or Copyrighted material is not intended to infringe Copyright.Meta
- BigData Data Analytics Financial Analytics Flickr Games Googolopoly How To Innovation iPhone iPhone 3GS landmark MyLife Poll restaurants reviews
Hey, I look forward to this tutorial’s completion. How long will it take you think?
This is good informational java tutorial. But you can learn more from Java tutorial for beginners. From this java tutorial you will find all information which you want. Thanks
This is a good tutorial.For more click here.
such a useful information, helping to sort out my queries.
Pretty soon…
I started preparing a document for my brother who is learning java..Then i thought it would be good for all learners…if i post it in my blog..
may i know abt u?
Good stuff in the blog regarding two-tier architecture.
Thanks for helping the begineers for jobs. And also please tell the current jobs that are in high priority. And also tell me whether Oracle is a good job compared to j2ee or java.
Thanks Bhuvana, It’s great stuff.
I’m Srilankan bourn Tamil Canadion.
Thanx for the material. It would be better if u can give the information about the IT jobs.
It’s good material.please send me the following email_id
I started learning java.please send me the material to this mail_id
marchana2006@gmail.com
hey i’ve started with this material ….can u send me more of the info at srikalyan_t@yahoo.co.in
Hi I started learning Java can u plz send me the complete material to aravind_madishetty@yahoo.com
Hi
Thanks for ue gr8 work. Could you please send me the material to sarithasurya@yahoo.com
Many Thanks
Saritha
@archana,srikalyan,aravind,saritha – Please do come to my blog for more materials…
hi i am ruchika with my background as Masters of commerce and i have stated reading java on my own.i have gone through it and it is really good one.would u tell me more information and send me some more material actulally i am preparing for sun java courses.
i want to u recomment the best book after reading the basic course of java programming for dummies for me send information,material and all other stuff u suggest me to read in my mail id ruchikaverma@go.com
hey ur material is great …..i want to take its print out…so can u plzzzzzzz send the material to my id…plzzzzzzzz
hey Manu here,
My id is manu_gorti@yahoo.com…
thanks,
Manu
Hi there
I wan to check ur material and would like to print it .Can u please send the material to my id rama_1411@yahoo.com.Thanks
hi ,
this is naveen. could u pls send the material to naveen_matrix@yahoo.co.in
Thanx ®ards
naveen
hi ,
I am sainath i want to learn java.can u send me java tutorials?
hi,
iam Manu i wan to learn java and im new to it..so can u plz help me out by sending your materials to this id n.manu@tvs-e.in
hello,
I need programs for practice on CORE JAVA, can you send me on my e-mail id:
meetankuronline@gmail.com.
Please provide me some useful links so that I can practice online also, and problems should be of medium level of difficulty.
i need complete java material. can u send it to me. my id is eeesh_a@yahoo.co.in
HI.. SRIKANTH HERE .. LIKE OTHERS I TOO STARTED WITH YOUR MATERIAL… CAN YOU PLEASE SEND THE COMPLETE THING TO MY MAIL .. sri.foreverurs@gmail.com
Are comments restricted on this blog? Thanks
hi
like others i too started with ur material.plz can u send the whole material to my id plz
cutepunni@yahoo.com
hey i’ve started with this material ….can u send me more of the info at nmmeenaa@gmail.com
i want to start with ur notes.
could anyone send me tamil notes to learn Java?
cud ya put up some interview based ques ……..the oneliners that will be helpful…….
thanks
can you get j2ee notes plssssssss
shiva_mano@yahoo.com
am started to studying java.so plz send me material .
hi i am started to studying java.plz send me study metireal.
This notes is very useful
pls send my mail ID
hi
like others i too started with ur material.plz can u send the whole material to my id plz
Hi this is a good tutorial for beginers to gain confidence on the subject. Could you please forward the total material on pittu.ramakrishna@gmail.com.
hi
i am looking for java basics to learn.
please send to my mail id.
hi
i am looking for java basics to learn.
please send to my mail id muggulladevi@yahoo.co.in
Hi I started learning Java can u plz send me the complete material to rajasameera@gmail.com
can u plz send me the complete material at bamaboy95.com13@yahoo.com
Hi started going through Java and OOPs concepts please send your material to my mail id rajani_reddy2003@yahoo.com
Anybody interested in viewing my tutorials, click on my link. I am doing some tutorials on using mysql, tomcat and a few other technologies.
I have done a project in IDS(intrusion detection system).i am doing my BE III yr. but still i am not clear in fundamentals.guide me in some good meterails. if any mail me -jeslinmehna@yahoo.in
you both are so beautiful. your jodi is really rocking on screen. ofcourse ur baby is the cutest baby in the universe…………………………… i wish u and ur baby sucessful and happiest life……………..
we r four friends. we r the biggest fans of u both ……… u both look beautiful, but we r little upset that ur next film is with 9thara(aadhavan) so v reqest u not to act with 9thara……………….
i want to interest to ur material. plz send it ur material to my mail id
Really this material is too good , please send this material to my email id : abc.mpt@gmail.com
hi dear friends .
i want to java programming ebook.please send it.
i want a script to hack accounts on tribal wars
UR MATERIALS ARE REALLY NICE .CAN U SEND ME ON MY ID..
i create this program in this jsp but not run in my system so please help me and send to all answer in my mail id
good triks both are working thanks keep adding like thi s stuff…
and mail me some more tutorial codes for learing java script..
thank you .
your work is very good .iam in sri lanka i want complete guidence notes which includes fundamentals. can you please mail me the notes to my email address
WOW!
Great Piece of work,I was searching the web for java tutorials, Glad i found your site, Really very helpful.
Keep going on…….
Really like your material. Can you send me complete materials to my mail id?
I can’t tell you how many times I’ve seen a “Hello World” program in tutorials.
Although, they are a nice set of tutorials; quite lucid.
I tried making some tutorials myself. But, ended up making an ass out of it.
hey!! ur work is gud 4 java starters. but i need some work on applets or swings. cud u help?
hi friends i am riswan… now i m interested to learn java on my own… bt i m poor in communication.. so can u pls send me the java materials in english as well as tamil frnds… my mail id is rishwan.cse@gmail.com
sir
I am a computer scince student and also a tamil medium.I am understand to know the portion of “JAVA 2″5th edition wirtten by Herbert schildt.So, I want notes in java in tamil.
If there is any notes in tamil please tell the name and author of the book.
Good effort dude , keep it up . I am also sharing my java knowledge to give back to community from where I learn java.
wow!
excellent going,
If you add more stuff about applets and applications it can be help full.
i want dis material to printout so send me material
Hi,
I am new to Java and this site really helps me. Came across one more useful site and posting it here. Hoping it will help some more beginers like me to Java.
http://www.softwaredevelopersworld.com/
i want java book plz sent me
Can you please send me the complete material …. I have started to learn JAVA.It would be helpful for me. Thank you.
wa05eem@gmail.com
Hi,
Please visit the following link to get more interview questions and books and more…
plz send all java applet easy program in grid,card,border,constarints
Hey really thanks a lot for the Java tutorial…
For Many and Latest Interview questions on java and Core java , please check the below link;
core java interview questions and answers for experianced
em facing an error non-static variable super cannot be referenced from static context
how do i remove it??
i want java book so please send me my id
good tutorials..
For javascript and basic java tutorials.. visit
http://anurag-tutorial.blogspot.com/
thanks
hi bhuvana, i am learning c sharp and new to the world of programming. Do you know anything on c sharp. i need a mentor.
http://www.quicklearnjava.blogspot.com
Ducat one of the best IT Training & Certification Company in India provides high quality IT Training on Latest Technologies with 100% Job Assistance.
DUCAT provides mca live project training in php,java,dot net, oracle, embedded system, c/c++,vlsi,sqt,networking,ccna,mcse,mcitp,cad,autocad,catia,pro-e red hat linux, greater noida and ghaziabad with 100% Guarantee job assistance.
QUERY FOR COURSES INFORMATION
hai… Im dhilip , and i need your help. Im a Bsc IT student. Please teach java through tamil.
http://www.iscjavaprograms.blogspot.com
http://www.java-programs-for-beginners.blogspot.com
Sample, simple, practice, have-fun programs for beginners in Java.
Highlights:
Recursion used for multiplication
Cross and noughts game(console based)
Number Names: convert number into words.
Easy to understand if u have the basic concepts of Java..
Please view and comment/like…
🙂
Not too bad, a more comprehensive tutorial can be found here, it is a hands-on tutorial and very effective: IT Learning – Java Tutorial
i want java book…… please send that to me….
plz send me any Struts and Hibernate study material if u have any anyone?
Hi,,
please send me EJb and spring study material if any one have.
Thanks a lot in advance!!
Good job done. Thanks for the nicely written tutorials.
If anyone also want to download the tutorials in PDF format, contact me.
package bank_pgm;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Scanner;
public class Bank {
ArrayList slist=new ArrayList();
ArrayList clist=new ArrayList();
Customer cust;
Scheme scm1=new Scheme(“SJ”,2000,4.5,5000,8.9);
Scheme scm2=new Scheme(“DJ”,3000,5.0,6000,9.5);
String scname = null;
double pamt = 0;
double amtaftdep = 0;
public void addScheme(){
slist.add(scm1);
slist.add(scm2);
System.out.println(“Details of scheme are:”);
System.out.println(“Name of scheme\t”+”Minimum Balance\t “+”Period\t”+”Penalty amount\t”+”Rate of interest”);
Iterator itr=slist.listIterator();
while(itr.hasNext())
{
Scheme s=itr.next();
System.out.println(s.getSname()+”\t “+s.getMinbal()+”\t\t “+s.getTime()+” \t “+s.getPenalty()+”\t “+s.getRateint());
}
}
public void addCustomer()
{
Customer cus=new Customer();
System.out.println(“Enter name of customer”);
Scanner sc=new Scanner(System.in);
String cname=sc.nextLine();
System.out.println(“Enter account no of customer”);
String acno=sc.nextLine();
clist.add(cus);
}
public void opendeposit(){
Customer cuso=new Customer();
System.out.println(“Enter the customer account no”);
Scanner sc=new Scanner(System.in);
String acno=sc.nextLine();
System.out.println(“Enter the scheme chosen by customer”);
String sname=sc.nextLine();
System.out.println(“Enter amount of deposit by customer”);
double damt=sc.nextDouble();
try
{ for(Scheme C:slist)
{
if(sname==(C.getSname()))
{
if(damt<=C.getMinbal())
{
System.out.println("Mininum balanceshould notbe less than Rs "+C.getMinbal());
}
else
{
System.out.println("Amount Deposited by customer is Rs "+damt);
}
}
}
}catch(Exception e)
{
e.printStackTrace();
}
cuso.setDepammount(damt);
cuso.setScmane(sname);
cuso.setAccno(acno);
clist.add(cuso);
System.out.println("Amount Deposited by customer is Rs "+cuso.getDepammount());
System.out.println("Scheme selected by customer is Rs "+cuso.getScmane());
System.out.println("Acc no of customer is "+cuso.getAccno());
}
public void amtpayaftp(){
Customer cc=new Customer();
double aftdepamt=0;
System.out.println("Enter the customer account no");
Scanner s=new Scanner(System.in);
String acno=s.nextLine();
for(Customer cu:clist)
{
if(acno.equals(cu.getAccno()))
{
System.out.println("Amount Deposited by customer is Rs "+cu.getDepammount());
System.out.println("Scheme selected by customer is Rs "+cu.getScmane());
System.out.println("Acc no of customer is Rs "+cu.getAccno());
pamt=cu.getDepammount();
scname=cu.getScmane();
}
}
for(Scheme S:slist)
{
if(scname.equals(S.getSname()))
{
aftdepamt=((pamt*+S.getRateint()*+S.getTime())/100)+pamt;
System.out.println("Amount payable at the end of deposit Rs:"+aftdepamt);
}
}
}
public void paypenalty(){
System.out.println("Enter the customer account no");
Scanner s=new Scanner(System.in);
String acno=s.nextLine();
System.out.println("Is customer willing to withdraw money before specified period");
System.out.println("Enter 1 if he wants to withdraw money else enter 0");
int x=s.nextInt();
String scname=null;
if(x==1)
{
System.out.println("Enter the no of years before specified period");
double no_yrs=s.nextDouble();
for(Customer cu:clist)
{
if(acno.equals(cu.getAccno()))
{
scname=cu.getScmane();
}
}
for(Scheme S:slist)
{
if(scname.equals(S.getSname())&&(no_yrs<S.getTime()))
{
System.out.println("Customer has to pay penalty amount of Rs:"+S.getPenalty());
}
}
}
else{
amtpayaftp();
}
}
}
//Program to manage library books
import java.io.*;
import java.util.*;
class Book{
String bname;
int bno,noofcopies;
public String getBname() {
return bname;
}
public int getBno() {
return bno;
}
public int getNoofcopies() {
return noofcopies;
}
public void setBname(String bname) {
this.bname = bname;
}
public void setBno(int bno) {
this.bno = bno;
}
public void setNoofcopies(int noofcopies) {
this.noofcopies = noofcopies;
}
}
public class Library {
public static void main(String[] args) throws Exception, IOException {
Uni un=new Uni();
int x=0;
do
{
System.out.println(“Options”);
System.out.println(“1.Add student”);
System.out.println(“2.Add Book”);
System.out.println(“3.issue books”);
System.out.println(“4.return books”);
System.out.println(“5.search book”);
System.out.println(“Enter ur choice”);
DataInputStream din=new DataInputStream(System.in);
x=Integer.parseInt(din.readLine());
switch(x)
{
case 1:
un.addStudent();
break;
case 2:
un.addBook();
break;
case 3:
un.issuebooks();
break;
case 4:
un.returnbooks();
break;
case 5:
un.searchbooks();
break;
default:
System.out.println(“Invalid choice”);
}
}while(x<6);
}
}
class Student{
String sname;
int rollno,reqcop;
public void setReqcop(int reqcop) {
this.reqcop = reqcop;
}
public int getReqcop() {
return reqcop;
}
public String getSname() {
return sname;
}
public int getRollno() {
return rollno;
}
public void setSname(String sname) {
this.sname = sname;
}
public void setRollno(int rollno) {
this.rollno = rollno;
}
}
class Uni{
ArrayList blist=new ArrayList();
ArrayList slist=new ArrayList();
int[] arr=new int[5];
public void addStudent()
{
Student s1=new Student();
System.out.println(“Enter name of student”);
Scanner sc1=new Scanner(System.in);
String name=sc1.nextLine();
s1.setSname(name);
System.out.println(“Enter student Rollno”);
int rn=sc1.nextInt();
s1.setRollno(rn);
System.out.println(“enter no of copies”);
int copies=sc1.nextInt();
s1.setReqcop(copies);
slist.add(s1);
}
public void addBook()
{
Book b1=new Book();
System.out.println(“Enter the name of book”);
Scanner bk=new Scanner(System.in);
String bn=bk.nextLine();
b1.setBname(bn);
System.out.println(“Enter book no”);
int bno=bk.nextInt();
b1.setBno(bno);
System.out.println(“enter no of copies”);
int copies=bk.nextInt();
b1.setNoofcopies(copies);
blist.add(b1);
}
public void issuebooks()
{
System.out.println(“Enter book no”);
Scanner sc=new Scanner(System.in);
int bno=sc.nextInt();
for(Book b:blist)
{
if(b.getBno()==bno)
{
if(b.getNoofcopies()== 0)
System.out.println(“Book not available”);
else
checkStud(b);
}
}
}
public void checkStud(Book obj)
{
System.out.println(“Enter student rollno”);
Scanner sc=new Scanner(System.in);
int sid=sc.nextInt();
for(Student stud:slist)
{
if(stud.getRollno()==sid)
{
if(stud.getReqcop()<=5)
{
System.out.println("Book Issued");
stud.setReqcop(stud.getReqcop()+1);
obj.setNoofcopies(obj.getNoofcopies()-1);
}
else
System.out.println("Only 5 books can be issued");
}
}
}
public void returnbooks()
{
System.out.println("Enter book id");
Scanner sc=new Scanner(System.in);
int id=sc.nextInt();
for(Book b:blist)
{
if(b.getBno()==id)
{
b.setNoofcopies(b.getNoofcopies()+1);
}
}
}
public void searchbooks()
{
System.out.println("Enter the name of the book");
Scanner sc=new Scanner(System.in);
String name=sc.next();
for(Book b:blist)
{
if(b.getBname().equalsIgnoreCase(name))
{
System.out.println("The details are:"+b.getBname()+" "+b.getNoofcopies());
}
}
}
}
import java.util.ArrayList;
import java.util.*;
import java.io.*;
public class College {
File f;
FileWriter fw;
FileReader fr;
BufferedReader br;
BufferedWriter bw;
ArrayList arr=new ArrayList();
Scanner sc=new Scanner(System.in);
public void addStudent()
{
Student s=new Student();
System.out.println(“eneter the name “);
String s1=sc.next();
System.out.println(“eneter the id “);
int s2=sc.nextInt();
s.setId(s2);
s.setName(s1);
arr.add(s);
}
public void removeStudent()
{
System.out.println(“eneter the id you want to remove “);
int s1=sc.nextInt();
for(Student st:arr)
{
if(st.getId()==s1)
{
int i=arr.indexOf(st);
arr.remove(i);
break;
}
}
}
public void updateStudent()
{
System.out.println(“eneter the id of the name you want to update “);
int s1=sc.nextInt();
for(Student st:arr)
{
if(st.getId()==s1)
{
// int i=arr.indexOf(st);
System.out.println(“eneter the new name “);
st.setName(sc.next());
}
}
}
public void displayStudent()
{
System.out.println(“details of student \n”);
for(Student st:arr)
{
System.out.println(st.toString());
}
}
public String[] tokanize(String str)
{
String[] st=new String[3];
int i=0;
StringTokenizer sm=new StringTokenizer(str,” “);
while(sm.hasMoreTokens())
{
st[i++]=sm.nextElement().toString();
}
return st;
}
public void readFileDataToArrayList()
{
try
{
f=new File(“student.txt”);
if(!f.exists())
{
System.out.println(“File doesnot exists”);
}
else
{
fr=new FileReader(f);
br=new BufferedReader(fr);
String str;Student s;
String arrayStr[]=new String[3];
while((str=br.readLine())!=null)
{
arrayStr=tokanize(str);
s=new Student();
s.setId(Integer.parseInt(arrayStr[0]));
s.setName(arrayStr[1]);
arr.add(s);
}
f.delete();
br.close();
}
}
catch(FileNotFoundException fnfe)
{
fnfe.printStackTrace();
}
catch(IOException e)
{
e.printStackTrace();
}
}
public void writeArrayListToFile()
{
try
{
f=new File(“student.txt”);
fw=new FileWriter(f);
bw=new BufferedWriter(fw);
for(Student stud:arr)
{
bw.write(stud.getId()+” “+stud.getName());
bw.newLine();
}
bw.close();
System.out.println(“Data written successfully”);
}
catch(FileNotFoundException fnfe)
{
fnfe.printStackTrace();
}
catch(IOException e)
{
e.printStackTrace();
}
}
}
package Library;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class Main {
static String Author;
static String name;
static String bookname;
static Integer Id;
static Integer cno;
static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
static ArrayList s=new ArrayList();
static HashMap hm=new HashMap();
public static void main(String args[])throws IOException{
hm.put(“Pavan”, “abc”);
hm.put(“pramod”, “xyz”);
while (true){
int menu;
System.out.println(“Menu”);
System.out.println(“1.Add Student”);
System.out.println(“2.Search book”);
System.out.println(“3.Issue book”);
System.out.println(“4.Return book”);
System.out.println(“5.Exit”);
System.out.println(“plz enter ur choice”);
menu=Integer.parseInt(br.readLine());
switch (menu){
case 1:
addstd();
break;
case 2:
searchbook();
break;
case 3:
issuebook();
break;
case 4:
returnbook();
break;
case 5:
System.exit(0);
default:
break;
}
}
}static void addstd()throws IOException{
System.out.println(“name”);
name = br.readLine();
System.out.println(“id”);
Id=Integer.parseInt(br.readLine());
System.out.println(“cno”);
cno=Integer.parseInt(br.readLine());
Student s1=new Student(name,Id,cno);
s.add(s1);
}
static void searchbook()throws IOException{
System.out.println(“enter author”);
Author=br.readLine();
System.out.println(Author);
Set<Map.Entry> set=hm.entrySet();
int count=0;
for(Map.Entry me:set){
Library l=new Library(me.getKey(), me.getValue());
if(l.getAuthor().equalsIgnoreCase(Author)){
System.out.println(“Book found”);
count++;
break;
}
}
if (count == 0){
System.out.println(“Book not found”);
}
}
static void issuebook()throws IOException
{
System.out.println(“enter author”);
Author=br.readLine();
System.out.println(“enter book name”);
bookname=br.readLine();
Set<Map.Entry> set=hm.entrySet();
int count=0;
for(Map.Entryme:set){
Library l=new Library(me.getKey(), me.getValue());
if(l.getAuthor().equalsIgnoreCase(Author))
{
System.out.println(“Issue Book”);
count++;
break;
}
}if(count==0){
System.out.println(“Book not issued”);
}
}static void returnbook()throws IOException{
System.out.println(“Enter bookname”);
bookname=br.readLine();
System.out.println(“author”);
Author=br.readLine();
Set<Map.Entry>set=hm.entrySet();
int count=0;
for(Map.Entry me:set)
{
Library l=new Library(me.getKey(), me.getValue());
if(l.getAuthor().equalsIgnoreCase(Author)){
System.out.println(“Book returned”);
count++;
break;
}
}if(count==0){
System.out.println(“Book not returned”);
}
}
}
import java.util.ArrayList;
import java.util.*;
import java.io.*;
import java.util.Scanner;
class myownex extends Exception{
String msg1;
public myownex(String msg) {
msg1=msg;
}
public String getMessege()
{
return msg1;
}
}
class Student {
Scanner sc=new Scanner(System.in);
private String name;
private int id;
public Student() {
}
public Student(String n,int i) {
name=n;
id=i;
}
public String getName() {
return name;
}
public void setName(String name) {
if(name!=null)
this.name = name;
else{
try {
throw new myownex(“please enter the vallid name”);
} catch (myownex e) {
System.out.println(e.getMessege());
}
}
}
public int getId() {
return id;
}
public void setId(int id1) {
if(id1!=0)
this.id= id1;
else
{
try {
throw new myownex(“please enter the vallid id”);
} catch (myownex e) {
System.out.println(e.getMessege());
}
}
}
public String toString(){
return name+” “+ id;
}
}
class College {
File f;
FileWriter fw;
FileReader fr;
BufferedReader br;
BufferedWriter bw;
ArrayList arr=new ArrayList();
Scanner sc=new Scanner(System.in);
public void addStudent()
{
Student s=new Student();
System.out.println(“eneter the name “);
String s1=sc.next();
System.out.println(“eneter the id “);
int s2=sc.nextInt();
s.setId(s2);
s.setName(s1);
arr.add(s);
}
public void removeStudent()
{
System.out.println(“eneter the id you want to remove “);
int s1=sc.nextInt();
for(Student st:arr)
{
if(st.getId()==s1)
{
int i=arr.indexOf(st);
arr.remove(i);
break;
}
}
}
public void updateStudent()
{
System.out.println(“eneter the id of the name you want to update “);
int s1=sc.nextInt();
for(Student st:arr)
{
if(st.getId()==s1)
{
// int i=arr.indexOf(st);
System.out.println(“eneter the new name “);
st.setName(sc.next());
}
}
}
public void displayStudent()
{
System.out.println(“details of student \n”);
for(Student st:arr)
{
System.out.println(st.toString());
}
}
public String[] tokanize(String str)
{
String[] st=new String[3];
int i=0;
StringTokenizer sm=new StringTokenizer(str,” “);
while(sm.hasMoreTokens())
{
st[i++]=sm.nextElement().toString();
}
return st;
}
public void readFileDataToArrayList()
{
try
{
f=new File(“student.txt”);
if(!f.exists())
{
System.out.println(“File doesnot exists”);
}
else
{
fr=new FileReader(f);
br=new BufferedReader(fr);
String str;Student s;
String arrayStr[]=new String[3];
while((str=br.readLine())!=null)
{
arrayStr=tokanize(str);
s=new Student();
s.setId(Integer.parseInt(arrayStr[0]));
s.setName(arrayStr[1]);
arr.add(s);
}
f.delete();
br.close();
}
}
catch(FileNotFoundException fnfe)
{
fnfe.printStackTrace();
}
catch(IOException e)
{
e.printStackTrace();
}
}
public void writeArrayListToFile()
{
try
{
f=new File(“student.txt”);
fw=new FileWriter(f);
bw=new BufferedWriter(fw);
for(Student stud:arr)
{
bw.write(stud.getId()+” “+stud.getName());
bw.newLine();
}
bw.close();
System.out.println(“Data written successfully”);
}
catch(FileNotFoundException fnfe)
{
fnfe.printStackTrace();
}
catch(IOException e)
{
e.printStackTrace();
}
}
}
public class Testall {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
College c=new College();
int ch=0;
c.readFileDataToArrayList();
while(true)
{
try{
System.out.println(“enetr teh choice 1-add student 2-remove student 3-update student 4-display student 5-exit”);
ch=sc.nextInt();
if (ch5)
throw new myownex(“enter the valid choice”);
}
catch(myownex e)
{
System.out.println(e.getMessege());
}
switch(ch)
{
case 1: c.addStudent();
break;
case 2:c.removeStudent();
break;
case 3:c.updateStudent();
break;
case 4:c.displayStudent();
break;
case 5:c.writeArrayListToFile();
System.exit(0);
break;
case 6:
//default :System.out.println(“invalid choice “);
}
}
}
}
import java.util.*;
class Patient
{
String name;
String mobile_no;
String OPID;
Scanner sc=new Scanner(System.in);
public Patient()
{
System.out.println(“Please enter the name of the patient”);
this.name=sc.next();
System.out.println(“Please enter the mobile of the patient”);
this.mobile_no=sc.next();
}
}
class Doctor
{
String name;
String dept;
int maxCount=0;
Scanner sc=new Scanner(System.in);
public Doctor()
{
System.out.println(“Please enter the name of the doctor”);
this.name=sc.next();
System.out.println(“Please enter the dept of the doctor”);
this.dept=sc.next();
}
}
public class Hospital
{
Doctor d;
Patient p;
Map hmd=new HashMap();
Map hmp=new HashMap();
Scanner sc=new Scanner(System.in);
public void addDoctor()
{
System.out.println(“Please enter the doctor id”);
hmd.put(sc.nextInt(),new Doctor());
}
public void addPatient()
{
System.out.println(“Please enter the opid”);
hmp.put(sc.nextInt(),new Patient());
}
public void searchAnyDoctor()
{
Set set = hmd.entrySet();
Iterator i = set.iterator();
while(i.hasNext())
{
Map.Entry me = (Map.Entry)i.next();
if(((Doctor)me.getValue()).maxCount<5)
{
{System.out.println("Congrats. you have got an appointment with doctor:"+((Doctor)me.getValue()).name +" of dept:"+((Doctor)me.getValue()).dept);((Doctor)me.getValue()).maxCount++;return;}
}
}
System.out.println("Sorry no free doctors available");
return;
}
public boolean searchPatient(int opid)
{
if(hmp.containsKey(opid)) return true;
else
return false;
}
public void bookAppointment()
{
System.out.println("Please enter the opid");
int opid=sc.nextInt();
if(searchPatient(opid))
{
System.out.println("Please enter the doctor id");
int did=sc.nextInt();
if(hmd.containsKey(did))
{
Set set = hmd.entrySet();
Iterator i = set.iterator();
while(i.hasNext())
{
Map.Entry me = (Map.Entry)i.next();
if(Integer.parseInt(me.getKey().toString())==did)
{
if(((Doctor)me.getValue()).maxCount<5)
{System.out.println("Congrats. you have got an appointment with doctor:"+((Doctor)me.getValue()).name +" of dept:"+((Doctor)me.getValue()).dept);((Doctor)me.getValue()).maxCount++;}
else
searchAnyDoctor();
}
}
}
else
System.out.println("invalid doctor id");
}
else
System.out.println("invalid patient id");
}
public static void main(String[] args)
{
int choice=0;
Scanner sc=new Scanner(System.in);//Library.init();
Hospital hsp=new Hospital();
while(true)
{
System.out.println("Enter ur choice 1-register patient,2-add doctors, 3-book appointment,4-exit");
choice=sc.nextInt();
switch(choice)
{
case 1:hsp.addPatient();
break;
case 2:hsp.addDoctor();
break;
case 3:hsp.bookAppointment();
break;
case 4:System.exit(0);
break;
default:System.out.println("invalid choice");
}
}
}
}
import java.io.*;
import java.util.*;
class HostelInfo extends StudentInfo
{
static boolean avail[][]=new boolean[3][3];public static int Room,Slot;
int total_no_of_rooms,remaining_rooms;
static int count;
static Scanner sc=new Scanner(System.in);
static float monthlyBalance;
public HostelInfo()
{
this.name=”abc”;
this.address=”asdf”;
this.total_balance=444f;
this.no_of_fdays=4;
}
public static void initialize()
{
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
avail[i][j]=true;
}
}count=0;
}
public static void see_available_slots()
{
System.out.println("———————————————————————");
System.out.println("ROOM NO Slot(0) Slot(1) Slot(2)");
System.out.println("———————————————————————");
for(int i=0;i<3;i++)
{
System.out.print((i)+" ");
for(int j=0;j<3;j++)
System.out.print(avail[i][j]+" ");
System.out.println();
}
System.out.println("———————————————————————");
}
public void allotRoom()
{
System.out.println("Plese enter the room no and slot number you want");
int roomNo=sc.nextInt();
int slotNo=sc.nextInt();
if(searchFreeSlot(roomNo,slotNo))
System.out.println("Congrats.Room and slot have been allocated");
else if(searchAnySlot())
System.out.println("Congrats.Room No:"+Room+" and Slot no:"+Slot+" has been allocated");
else
System.out.println("Sorry! no free rooms available");
}
public boolean searchFreeSlot(int rno,int sno)
{
if(avail[rno][sno]==true)
{
avail[rno][sno]=false;
this.RoomNo=rno;this.SlotNo=sno;
return true;
}
else
return false;
}
public boolean searchAnySlot()
{
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
if(avail[i][j]==true) {Room=i;Slot=j;avail[i][j]=false;this.RoomNo=i;this.SlotNo=j;return true;}
}
}
return false;
}
public void deallocateRoom()
{
System.out.println("Plese enter the room no and slot number you want to release");
int roomNo=sc.nextInt();
int slotNo=sc.nextInt();
avail[roomNo][slotNo]=true;
System.out.println("Room has been deallocated successfully");
}
public static void calculateRent()
{
System.out.println("Please enter the total monthly expense");
monthlyBalance=sc.nextFloat()/(HostelInfo.count+1);
}
public void calculateMessBill()
{
System.out.println("Enter the no of days food taken by "+this.name);
this.total_balance=monthlyBalance+((this.no_of_fdays=sc.nextInt())*100);
}
public static void main(String[] args) throws NullPointerException
{
HostelInfo[] hi=new HostelInfo[9];
for(int k=0;k<9;k++)hi[k]=new HostelInfo();
HostelInfo.initialize();
int choice=1;
while(true)
{
System.out.println("Please select your task 1-allocate room 2-deallocate room 3- calculate balance 4-see available free slots 5-see student info 6-exit");
choice=HostelInfo.sc.nextInt();
switch(choice)
{
case 1:if(HostelInfo.count<9){
hi[HostelInfo.count].getDetails();hi[HostelInfo.count].allotRoom();HostelInfo.count++;
}
else
System.out.println("All rooms are full.you have to deallocate the rooms to accomdate extra students");
break;
case 2://hi.deallocateRoom();HostelInfo.count–;
break;
case 3:
HostelInfo.calculateRent();
for(int i=0;i<HostelInfo.count;i++)
{
hi[i].calculateMessBill();
}
//System.out.println("This module not yet implemented");
break;
case 4:HostelInfo.see_available_slots();
break;
case 5:System.out.println("Name Total_expense Days");
System.out.println("—————————————————————————————————");
for(int i=0;i<HostelInfo.count;i++)
{
System.out.println(hi[i].name+" "+hi[i].total_balance+" "+hi[i].no_of_fdays);
}
System.out.println("—————————————————————————————————");
break;
case 6:System.exit(0);
break;
default:System.out.println("Invalid choice");
}
}
}
}
class StudentInfo
{
String name;
String mobile_no;
String address;
String usn;
int RoomNo,SlotNo;
int no_of_fdays;
float total_balance;
Scanner sc=new Scanner(System.in);
public void getDetails()
{
System.out.println("Please enter the name");
this.name=sc.next();
System.out.println("Please enter the mobile no.");
this.mobile_no=sc.next();
System.out.println("Please enter the address");
this.address=sc.next();
System.out.println("Please enter the usn");
this.usn=sc.next();
this.RoomNo=this.SlotNo=4;
no_of_fdays=0;
total_balance=0.0f;
}
public void displyDetails()
{
System.out.println("name:"+this.name);
System.out.println("name:"+this.name);
System.out.println("name:"+this.name);
System.out.println("name:"+this.name);
System.out.println("name:"+this.name);
System.out.println("name:"+this.name);
if(this.RoomNo==4 && this.SlotNo==4)
System.out.println("Room not yet been allocated");
else
System.out.println("ROOM#:"+this.RoomNo+" SLOT#:"+this.SlotNo);
}
}
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOError;
import java.io.IOException;
import java.util.ArrayList;
public class Main {
public static void main(String args[]) {
/*try {
File f = new File(“C:\\shilpa\\sample.txt”);
FileWriter fw = new FileWriter(f);
BufferedWriter bw = new BufferedWriter(fw);
bw.write(“shilpa:1\nsweta:2\nsmita:3\n”);
bw.close();
fw.close();
} catch (IOException e) {
System.out.println(e.getMessage());
}*/
ArrayList students = new ArrayList();
try{
File f = new File(“C:\\shilpa\\sample.txt”);
FileReader fr = new FileReader(f);
BufferedReader br = new BufferedReader(fr);
String line = br.readLine();
while(line!=null){
// System.out.println(line);
int i = line.indexOf(“:”);
String name = line.substring(0,i);
String rollNum = line.substring(i+1,line.length());
Student s = new Student(name,rollNum);
students.add(s);
line= br.readLine();
}
System.out.println(“finished reading file”);
br.close();
fr.close();
}catch(IOException e){
System.out.println(e.getMessage());
}
System.out.println(“printing array”);
for(Student s1: students){
System.out.println(s1.getName() +”:”+s1.getRollNum());
}
Student a = new Student(“shilpa”, “1”);
Student b = new Student(“shilpa”, “2”);
System.out.println(a.equals(b));
String str=new String(“abc”);
String str1 = new String(“abc”);
System.out.println(str.equals(str1));
}
}
Pls anyone help me to know interface concepts in java.
nice explination……
have a look at careerbless.com for basic java tutorials
plz send all java applet easy program in grid,card,border,constarints
very bad
I’m gone to tell my little brother, that he should also go to see this web site on regular basis to get updated from most up-to-date gossip.
alhlmjjqbqny
nsqajgrhgyoi
yes good but HACKING not working
npmrwfwbkrfn
great post..thanks for sharing this useful java tutorial information with us.
very interesting hub of information.
plz also visitcore-java-concepts
very interesting hub of information.
plz also visitcore java concepts
very interesting hub of information.
plz also visit core java concepts
Thanks for helping the begineers for jobs. And also please tell the current jobs that are in high priority. And also tell me whether Oracle is a good job compared to j2ee or java.
very Detail Description visit for java concepts to learn more
great post..thanks for sharing this useful java tutorial information with us
Really a helpful post for the beginners. Thanks for sharing it. I am quite satisfied with this post.
Really a great Post..it is a vey useful for me……
When developing embedded applications, you need to have the right tools. That is, tools that integrate seamlessly with your embedded platform. Geertjan Wielenga created a screencast to demonstrate how NetBeans IDE simplifies Java development on the Raspberry Pi.Web9Cloud believe in an open working relationship produces a positive and productive work environment that results in effective and low-cost solutions. We maximize the customer benefits by bringing the most pioneering solutions.
great blog ever for jAVA
vijay hero dance super
Thanks for Information Java is an object-oriented programming language
Thanks for Information Java is an object-oriented programming language
I am fresher for java,please guide me send me the notes sir
Hey thanks for the share
this blog is very nyc
This blog is having the general information. Got a creative work and this is very different one.We have to develop our creativity mind.This blog helps for this. Thank you for this blog. This is very interesting and useful.
thnaks for share. it’s very useful.
very useful blog which helps a lot for students who need to learn new things on Java
Thank you so much
Keep sharing on Learn Java in 10 hours @
Creating Great content regularly is very tough. Your points have motivated me. Excellent blog after reading this I am impressed a lot.
Hey,
Very useful and needful information you shared!! Thank you and Keep posting..
Thanks for helping the begineers for jobs. And also please tell the current jobs that are in high priority. And also tell me whether Oracle is a good job compared to java.
Ar u Interested go to family trip at Turkey.
Hi Everyone,
This is very useful and needful information you shared, Thank you, and Keep posting.
Are u looking for Best GRE Coaching in Hyderabad?
Hey,
This is Very useful and needful information you shared!! Thank you and Keep posting..