Click here to Skip to main content
       

Java

 
AnswerRe: JSF PinmvpRichard MacCutchan7-Jan-13 7:31 
QuestionJSF with Tiles Pinmembergurpreetsingh201531-Dec-12 1:12 
AnswerRe: JSF with Tiles Pinmemberrkpandey201331-Dec-12 1:21 
AnswerRe: JSF with Tiles PinmvpRichard MacCutchan31-Dec-12 1:54 
QuestionAnnotation PingroupVijay Kumar Jaiswal30-Dec-12 19:20 
AnswerRe: Annotation PinmemberTorstenH.30-Dec-12 22:35 
AnswerRe: Annotation PinmemberPhat (Phillip) H. VU2-Jan-13 23:14 
AnswerRe: Annotation [modified] PinmemberApril Fans3-Jan-13 16:44 
AnswerRe: Annotation Pinmembermuthu shankar7-Jan-13 5:30 
AnswerRe: Annotation [modified] PinmemberApril Fans16-Jan-13 22:58 
QuestionCan some one port this java code to c#? PinmemberDanish Samil26-Dec-12 0:28 
AnswerRe: Can some one port this java code to c#? PinmemberTorstenH.28-Dec-12 0:56 
GeneralRe: Can some one port this java code to c#? PinmemberDanish Samil30-Dec-12 23:46 
Questionwhy I have to use Pinmemberdemo 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 PinmvpRichard MacCutchan25-Dec-12 22:29 
AnswerRe: why I have to use PinmemberTorstenH.28-Dec-12 0:54 
GeneralRe: why I have to use Pinmemberdemo 21-Jan-13 18:53 
QuestionJava Netbeans Error Regarding Arraylist in BufferedWriter Method Pinmember100,00121-Dec-12 10:02 
AnswerRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method PinmvpRichard MacCutchan22-Dec-12 0:03 
GeneralRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method PinmemberTorstenH.22-Dec-12 2:23 
GeneralRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method PinmvpRichard MacCutchan22-Dec-12 2:31 
GeneralRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method PinmemberTorstenH.22-Dec-12 2:42 
GeneralRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method PinmvpRichard MacCutchan22-Dec-12 2:53 
GeneralRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method [modified] Pinmember100,00122-Dec-12 14:12 
GeneralRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method PinmvpRichard MacCutchan23-Dec-12 0:30 
AnswerRe: Java Netbeans Error Regarding Arraylist in BufferedWriter Method PinmemberTorstenH.22-Dec-12 2:19 
Questionjava Pingroupquest4knowledge21-Dec-12 7:46 
AnswerRe: java PinmvpRichard MacCutchan21-Dec-12 23:50 
AnswerRe: java [modified] PinmemberApril Fans22-Dec-12 22:15 
GeneralRe: java Pingroupquest4knowledge13-Jan-13 1:33 
Questionproblem in running derby database PinmemberMember 858607221-Dec-12 3:38 
AnswerRe: problem in running derby database PinmemberTorstenH.22-Dec-12 2:29 
Questionexecutive java program PinmemberOmarSH20-Dec-12 23:41 
AnswerRe: executive java program PinmvpRichard MacCutchan20-Dec-12 23:53 
GeneralRe: executive java program PinmemberOmarSH21-Dec-12 4:06 
GeneralRe: executive java program PinmvpRichard MacCutchan21-Dec-12 4:27 
GeneralRe: executive java program PinmemberOmarSH21-Dec-12 4:43 
GeneralRe: executive java program PinmvpRichard MacCutchan21-Dec-12 5:06 
GeneralRe: executive java program PinmemberOmarSH21-Dec-12 9:28 
GeneralRe: executive java program PinmvpRichard MacCutchan21-Dec-12 23:56 
AnswerRe: executive java program PinmemberStephen Dycus21-Dec-12 2:42 
GeneralRe: executive java program PinmemberOmarSH21-Dec-12 4:05 
Questionprogramming Pingroupquest4knowledge19-Dec-12 0:15 
AnswerRe: programming PinmvpRichard MacCutchan19-Dec-12 1:00 
GeneralRe: programming Pingroupquest4knowledge20-Dec-12 7:39 
AnswerRe: programming PinmemberApril Fans19-Dec-12 17:40 
GeneralRe: programming PinmvpRichard MacCutchan20-Dec-12 0:11 
GeneralRe: programming Pingroupquest4knowledge20-Dec-12 7:44 
GeneralRe: programming [modified] PinmemberApril Fans27-Dec-12 4:54 
QuestionInfix to Prefix, Incorrect output PinmemberSamuelSkenzy15-Dec-12 15:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web04 | 2.8.141223.1 | Last Updated 24 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid