Click here to Skip to main content
12,820,914 members (34,055 online)
   

Java

 
AnswerRe: Annotation Pin
Phat (Phillip) H. VU2-Jan-13 23:14
memberPhat (Phillip) H. VU2-Jan-13 23:14 
AnswerRe: Annotation Pin
April Fans3-Jan-13 16:44
memberApril Fans3-Jan-13 16:44 
AnswerRe: Annotation Pin
muthu shankar7-Jan-13 5:30
membermuthu shankar7-Jan-13 5:30 
AnswerRe: Annotation Pin
April Fans16-Jan-13 22:58
memberApril Fans16-Jan-13 22:58 
QuestionCan some one port this java code to c#? Pin
Danish Samil26-Dec-12 0:28
memberDanish Samil26-Dec-12 0:28 
AnswerRe: Can some one port this java code to c#? Pin
TorstenH.28-Dec-12 0:56
memberTorstenH.28-Dec-12 0:56 
GeneralRe: Can some one port this java code to c#? Pin
Danish Samil30-Dec-12 23:46
memberDanish Samil30-Dec-12 23:46 
Questionwhy I have to use Pin
demo 225-Dec-12 18:47
memberdemo 225-Dec-12 18:47 
Hi guys I need some one who really worked in series project to explain some concept


my teacher making a big story about private variable.

people always says we used private to make java hide the containing
.

package Student;


public class Student {

public static void main(String[] args) {


    information x = new information();
     x.ID();




{

package Student ;

 
public class information{

         private  int ID=0;
         private string name="";
           private  int GPA =0;

         }



I know I can't change ID without using set and get but this my question


if I will use set and get I can make my life easy just make ID like this

public int ID=0;



instead using set and get method.


my teacher said to protect the information from user !!!!!!!!


I don't why he said that ?

because user will see message like enter number and then the code will do calculation

like :

Please enter two Numbers :

5

4

The result : 9


So I still I don't know why I should use private which force me to use set and get .




please guys help me and remember I know this stupid question but I ask because I know how to use private but I don't why ?


before I just write this question I read and watch online youtube but there nothing I get


I'm a person who has only small memory takes only logical things and throw illogical thing.
AnswerRe: why I have to use Pin
Richard MacCutchan25-Dec-12 22:29
mvpRichard MacCutchan25-Dec-12 22:29 
AnswerRe: why I have to use Pin
TorstenH.28-Dec-12 0:54
memberTorstenH.28-Dec-12 0:54 
GeneralRe: why I have to use Pin
demo 21-Jan-13 18:53
memberdemo 21-Jan-13 18:53 
QuestionJava Netbeans Error Regarding Arraylist in BufferedWriter Method Pin
100,00121-Dec-12 10:02
member100,00121-Dec-12 10:02 
AnswerRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method Pin
Richard MacCutchan22-Dec-12 0:03
mvpRichard MacCutchan22-Dec-12 0:03 
GeneralRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method Pin
TorstenH.22-Dec-12 2:23
memberTorstenH.22-Dec-12 2:23 
GeneralRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method Pin
Richard MacCutchan22-Dec-12 2:31
mvpRichard MacCutchan22-Dec-12 2:31 
GeneralRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method Pin
TorstenH.22-Dec-12 2:42
memberTorstenH.22-Dec-12 2:42 
GeneralRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method Pin
Richard MacCutchan22-Dec-12 2:53
mvpRichard MacCutchan22-Dec-12 2:53 
GeneralRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method Pin
100,00122-Dec-12 14:12
member100,00122-Dec-12 14:12 
GeneralRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method Pin
Richard MacCutchan23-Dec-12 0:30
mvpRichard MacCutchan23-Dec-12 0:30 
AnswerRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method Pin
TorstenH.22-Dec-12 2:19
memberTorstenH.22-Dec-12 2:19 
Questionjava Pin
quest4knowledge21-Dec-12 7:46
groupquest4knowledge21-Dec-12 7:46 
AnswerRe: java Pin
Richard MacCutchan21-Dec-12 23:50
mvpRichard MacCutchan21-Dec-12 23:50 
AnswerRe: java Pin
April Fans22-Dec-12 22:15
memberApril Fans22-Dec-12 22:15 
GeneralRe: java Pin
quest4knowledge13-Jan-13 1:33
groupquest4knowledge13-Jan-13 1:33 
Questionproblem in running derby database Pin
Member 858607221-Dec-12 3:38
memberMember 858607221-Dec-12 3:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 20 Mar 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid