Which is better String null or should i initialize to blank ?

Hi
I am persisting one string in coherence which can be null for few cases. so putting null or blank which is better in coherence ?

Assignment "null" for String references is good because Coherence will use less space of storage during serialization. It other terms, this is good for performance during replication and synchronization.
Cheers,
Ricardo Ferreira

Similar Messages

  • Editing Red Dragon Raw 6k Footage with Premiere CC and/or CC 2014 - Which is better and what issues should I expect?

    Hi All
    As the title asks;
    1. Are there any known issues when Editing Red Dragon raw 6k footage in Premiere Pro CC/CC14 ?
    2. Which version of the software would be the best choice ? CC/CC 2014 (I have both)
    This is my first Red Dragon 6k Project in premiere CC software and although I have used CC extensively since its release  I am working with a tight turnaround so making sure I have as much info as possible to troubleshoot. (if needed)
    This question is directly related to the software and any known issues.  It is not hardware related as we are setup for that side of things with very fast SSD -> Thunderbolt storage and powerful machines.
    Any info or experiences would be greatly appreciated
    Thanks
    Piers

    Hi Piers - did you ever get an answer or figure out a good workflow for editing 6K in premiere?
    If so, i'd appreciate you sharing what you've learned.
    Thanks!

  • Which is better storing string values in Map or String buffer

    Hi,
    I have a store a 10 string values in a cookie. Do i use a String buffer and append all values or put it in a hash map.
    If i put in a string buffer i have to use a string tokenizer to loop and extract the values., but if i am using a map then
    retrieval will be easier, but in terms of memory management, which is better. as i have to create this cookie for every unique IP hitting my site.
    Thanks,
    Viiveek

    viiveek wrote:
    I have a store a 10 string values in a cookie. Do i use a String buffer and append all values or put it in a hash map.
    If i put in a string buffer i have to use a string tokenizer to loop and extract the values., but if i am using a map then
    retrieval will be easier, but in terms of memory management, which is better. as i have to create this cookie for every unique IP hitting my site. In terms of memory management, StringBuffer could potentially be better as there is no need to keep key objects in memory.
    That doesn't make it a good idea. The bytes of memory you'd lose by using a Map would be made up by the fact that Map was expressly made for storing key/value pairs. Memory management should be about the 200th factor you should consider.

  • Which is better and why a = new String("AA") or a = "AA"

    Hi,
    Which is better and why
    String a = new String("AA") or
    String a = "AA"
    Does invoking a construtor waste memory? Please explain in detail.
    Thanks in advance
    Deepak

    > So in case "AA" not there in string pool,
    That is not correct.
    does new creates "AA" on string pool as well as heap memory?Yes. The literal "AA" points to a pooled String object. The new operator creates a new String object with the same character sequence ("AA"). You can verify this with a little code...
    String s = new String("AA");
    assert s != "AA";
    assert s.equals("AA");
    assert s.intern() == "AA";~

  • Should I buy Imac 27'' 3.1 or the new imac 27'' 2.9, which is better?

    Should I buy Imac 27'' 3.1 or the new imac 27'' 2.9, which is better? The use to which it is going to give is photographs, video, text processing. If opt for the new'll have to buy an external drive for recording of videos and photographs.

    Photos, text & most other things should be fine on either, Video may be a bit better with the faster one, but Video card options may be a far bigger deal.

  • What USB 3.0 card should I get for early 2009 Mac Pro so I can connect the Drobo 5D? They say get CalDigit or Sonnet. Anyone have preference or experience with reliability. Trying to find which is better.

    What USB 3.0 card should I get for early 2009 Mac Pro so I can connect the Drobo 5D? They say get CalDigit or Sonnet. Anyone have preference or experience with reliability with this. I am running Lion and Trying to find which is better as I know from experience not all cards are created equal. Thanks in advance for your help!

    yakov536 wrote:
    High Point RocketU Quad USB 3.0 for Mac is working great for me. Had an issue with CD/DVD Drive which was resolved with most current driver downloaded from the support site.
    Running Moutain Lion on Early 2009, mirroring two Seagate Go Flex 2TB USB 3.0 Drives. Installed in Slot 4.
    Using it primarily with VMWare Fusion for Virtual Drives. Windows, Unbuntu and other OS running really well.
    HPT Support was responsive and very helpfull using the WEB Portal under the product page.
    I have some comments and a suggestion:
    Have you tried your setup with a SD/CF combo card reader (like the Lexar or Kingston FCR-H63)? Does the card appear on the desktop when first plugged in?
    Did you need to fool around with any kind of power issues in installing this card in the x4 PCIe slot of the MacPro?
    Suggestion. Have you tried one of the fixed in this article to cure the BT issues in MacPro 3,1?
    Good luck.
    Henry

  • Which is better ListIterator or Simple list.size() in for loop

    Hi everybody
    I have one scenario in which, I need to delete the duplicate values from the list (Note : Duplicate values are coming in sequence).
    I tried to approaches as follows
    1) Using ListIterator
    I iterated all values and if I found any duplicate then I called remove() method of Iterator.
    2) I made another ArrrayList object, and iterated the old list using size() and for loop, and if I found unique value then I added that value to the new ArrayList.
    I also created one test java file to find out the performance in both cases. But I am not pretty sure that this test is correct or not. Please suggest me which approach is correct.
    code For Test
    public class TestReadonly {
         public static void main(String[] args) {
              List list = new ArrayList();
              long beforeHeap = 0,afterHeap = 0;
              long beforeTime = 0,afterTime = 0;
              addElementsToList(list);
              Collections.sort(list);
              callGC();
              beforeHeap = Runtime.getRuntime().freeMemory();
              beforeTime = System.currentTimeMillis();
              System.out.println(" Before "+System.currentTimeMillis()+" List Size "+list.size()+" heap Size "+beforeHeap);
              new TestReadonly().deleteDuplicated1(list);
              afterHeap = Runtime.getRuntime().freeMemory();
              afterTime = System.currentTimeMillis();
              System.out.println(" After  "+System.currentTimeMillis()+" List Size "+list.size()+" heap Size "+afterHeap);
              System.out.println(" Time Differance "+(afterTime-beforeTime)+" Heap Differance "+(afterHeap-beforeHeap));
              list.clear();
              addElementsToList(list);
              Collections.sort(list);
              callGC();
              beforeHeap = Runtime.getRuntime().freeMemory();
              beforeTime = System.currentTimeMillis();
              System.out.println(" Before "+System.currentTimeMillis()+" List Size "+list.size()+" heap Size "+beforeHeap);
              list = new TestReadonly().deleteDuplicated2(list);
              afterHeap = Runtime.getRuntime().freeMemory();
              afterTime = System.currentTimeMillis();
              System.out.println(" After  "+System.currentTimeMillis()+" List Size "+list.size()+" heap Size "+afterHeap);
              System.out.println(" Time Differance "+(afterTime-beforeTime)+" Heap Differance "+(afterHeap-beforeHeap));
          * @param list
         private static void addElementsToList(List list) {
              for(int i=0;i<1000000;i++) {
                   list.add("List Object"+i);
              for(int i=0;i<10000;i++) {
                   list.add("List Object"+i);
         private static void callGC() {
              Runtime.getRuntime().gc();
              Runtime.getRuntime().gc();
              Runtime.getRuntime().gc();
              Runtime.getRuntime().gc();
              Runtime.getRuntime().gc();
         private void deleteDuplicated1(List employeeList) {
              String BLANK = "";
              String currentEmployeeNumber = null;
              String previousEmployeeNumber = null;
              ListIterator iterator = employeeList.listIterator();
              while (iterator.hasNext()) {
                   previousEmployeeNumber = currentEmployeeNumber;
                   currentEmployeeNumber = (String) iterator.next();
                   if ((currentEmployeeNumber.equals(previousEmployeeNumber))
                             || ((BLANK.equals(currentEmployeeNumber) && BLANK
                                       .equals(previousEmployeeNumber)))) {
                        iterator.remove();
         private List deleteDuplicated2(List employeeList) {
              String BLANK = "";
              String currentEmployeeNumber = null;
              String previousEmployeeNumber = null;
              List l1 = new ArrayList(employeeList.size());
              for (int i =0;i<employeeList.size();i++) {
                   previousEmployeeNumber = currentEmployeeNumber;
                   currentEmployeeNumber = (String) employeeList.get(i);
                   if (!(currentEmployeeNumber.equals(previousEmployeeNumber))
                             || ((BLANK.equals(currentEmployeeNumber) && BLANK
                                       .equals(previousEmployeeNumber)))) {
                        l1.add(currentEmployeeNumber);
              return l1;
    Output
    Before 1179384331873 List Size 1010000 heap Size 60739664
    After 1179384365545 List Size 1000000 heap Size 60737600
    Time Differance 33672 Heap Differance -2064
    Before 1179384367545 List Size 1010000 heap Size 60739584
    After 1179384367639 List Size 1000000 heap Size 56697504
    Time Differance 94 Heap Differance -4042080

    I think, you test is ok like that. Although I would have tested with two different applications, just to be shure that the heap is clean. You never know what gc() actually does.
    Still, your results show what is expected:
    Approach 1 (List iterator) takes virtually no extra memory, but takes a lot of time, since the list has to be rebuild after each remove.
    Approach 2 is much faster, but takes a lot of extra memory, since you need a "copy" of the original list.
    Basically, both approaches are valid. You have to decide depending on your requirements.
    Approach 1 can be optimized by using a LinkedList instead of an ArrayList. When you remove an element from an ArrayList, all following elements have to be shifted which takes a lot of time. A LinkedList should behave better.
    Finally, instead of searching for duplicates, consider to check for duplicates when filling the list or even use a Map.
    Tobias

  • Difference between String=""; and String =null

    I want to know the difference especially the ADVANTAGE between the following-
    1. String s="";
    String s="ABC"
    and
    String s;
    String s="ABC";
    or String s=null;
    String s="ABC";
    2. Object anyObject;
    anyObject-new Object();
    and
    Object anyObject=null;
    anyObject=new Object();

    Tanvir007 wrote:
    I want to know the difference especially the ADVANTAGE between the following-
    1. String s="";s points to the empty string--the String object containing no characters.
    String s="ABC"s points to the String object containing the characters "ABC"
    String s; Declares String reference varialbe s. Doesn't not assign it any value. If it's a local variable, it won't have a value until you explicitly assign it. If it's a member variable, it will be given the value null when the enclosing object is created.
    String s="ABC";Already covered above.
    or String s=null;s does not point to any object.
    String s="ABC";???
    You've already asked this twice.
    Are you talking about doing
    String s = null;
    String s = "ABC";right after each other?
    You can't do that. You can only declare a variable once.
    If you mean
    String s = null;
    s = "ABC";It just does what I described above, one after the other.
    2. Object anyObject;
    anyObject-new Object();
    and
    Object anyObject=null;
    anyObject=new Object();As above: In the first case, its value is undefined until the new Object line if it's a local, or it's null if it's a member.
    As for which is better, it depends what you're doing.

  • Coding Preference ..Which is better for memory?

    Hey all,
    Javas garbage collection is sweet. However, I was reading somewhere that setting some objects to null after I'm done with them will actually help.
    (help what .. I'm not sure.. my guess is memory used by the JVM)
    Thus I have two ways to do the same thing and I'd like to hear peoples comments on which is "better" ... or will yield faster performance.
    Task: I have a Vector of Strings (called paths) that hold absolute file paths. (Don't ask why I didn't use a String[]) I'd like to check and see if they exist, and if not, create them... I'll use the createNewFile() method for that.
    Method A -- Here I'll reuse that File object
    public void myMethod()throws Exception{
    File file = null;
    for(int i = 0; i < paths.size(); i++){
      file = new File(paths.get(i).toString());
      boolean made  = file.createNewFile();
      if(made){doSomething();}
    file = null;
    }Method B -- Here I'll use um... "dynamically made" ones that I won't eventually be set back to null
    public void myMethod()throws Exception{
    for(int i = 0; i < paths.size(); i++){
      boolean made  = (new File(paths.get(i).toString())).createNewFile();
      if(made){doSomething();}
    }So when the code eventually exists myMethod, the object "file" will be out of scope and trashed.... correct? If thats the case, then would there be any other differences between the two implementations?
    Thanks

    There's no real difference between the two. Choose the style you prefer,
    although in the first one I'd lose the "file = null" statement since that
    variable is about to disappear, and I'm move the definition into the loop
    -- always give variables as small a scope as possible, mainly to
    keep the logic simple:
    public void myMethod()throws Exception{
        for(int i = 0; i < paths.size(); i++){
            File file= new File(paths.get(i).toString());
            boolean made  = file.createNewFile();
             if(made){doSomething();}
    }

  • Which is better, Double Buffering 1, or Double Buffering 2??

    Hi,
    I came across a book that uses a completely different approach to double buffering. I use this method:
    private Graphics dbg;
    private Image dbImage;
    public void update() {
      if (dbImage == null) {
        dbImage = createImage(this.getSize().width, this.getSize().height);
        dbg = dbImage.getGraphics();
      dbg.setColor(this.getBackground());
      dbg.fillRect(0, 0, this.getSize().width, this.getSize().height);
      dbg.setColor(this.getForeground());
      paint(dbg);
      g.drawImage(dbImage, 0, 0, this);
    }that was my method for double buffering, and this is the books method:
    import java.awt.*;
    public class DB extends Canvas {
         private Image[] backing = new Image[2];
         private int imageToDraw = 0;
         private int imageNotDraw = 1;
         public void update(Graphics g) {
              paint(g);
         public synchronized void paint(Graphics g) {
              g.drawImage(backing[imageToDraw], 0, 0, this);
         public void addNotify() {
              super.addNotify();
              backing[0] = createImage(400, 400);
              backing[1] = createImage(400, 400);
              setSize(400, 400);
              new Thread(
                   new Runnable() {
                        private int direction = 1;
                        private int position = 0;
                        public void run() {
                             while (true) {
                                  try {
                                       Thread.sleep(10);
                                  }catch (InterruptedException ex) {
                                  Graphics g = backing[imageNotDraw].getGraphics();
                                  g.clearRect(0, 0, 400, 400);
                                                    g.setColor(Color.black);
                                  g.drawOval(position, 200 - position, 400 - (2 * position), 72 * position);
                                  synchronized (DB.this) {
                                       int temp = imageNotDraw;
                                       imageNotDraw = imageToDraw;
                                       imageToDraw = temp;
                                  position += direction;
                                  if (position > 199) {
                                       direction = -1;
                                  }else if (position < 1) {
                                       direction = 1;
                                  repaint();
              ).start();
         public static void main(String args[]) {
              Frame f = new Frame("Double Buffering");
              f.add(new DB(), BorderLayout.CENTER);
              f.pack();
              f.show();
    }which is better? I noticed smoother animation with the later method.
    Is there no difference? Or is it just a figment of my imagination??

    To be fair if you download an applet all the class files are stored in your .jpi_cache, and depending on how that game requests its graphics sometimes they are stored there to, so really if you have to download an applet game twice, blame the programmer (I've probably got that dead wrong :B ).
    But, what's wrong with Jars. They offer so much more.
    No offence meant by this Malohkan but if you can't organize your downloaded files the internet must really be a landmine for you :)
    Personally I'd be happy if I never seen another applet again, it seems java is tied to this legacy, and to the average computer user it seems that is all java is capable of.
    Admitidly there are some very funky applets out here using lots of way over my head funky pixel tricks, but they would look so much better running full screen and offline.

  • Singleton vs static - which is better?

    Of the two approaches -
    a class which can be used by accessing its ONLY instance(singleton) or a class which has a set of static methods which can be invoked on the class itself
    which is better and why? Or are these just two 'styles' of programming?
    I always get confused as to which way to go? I tend to prefer to have static methods on the class instead of a singleton.
    All insights/comments/ideas welcome.
    Thanks

    Well, there are a few questions you can ask - does the method cause any changes of state, or is it a pure function? If the latter, static is probably the way to go.
    The way you are talking, I gather that there is some state involved.
    Next question: does it make sense for there to be more than one of these per JVM? Not only in the way you currently envision it, but at all, anywhere. For example, consider the list of Strings that the String class keeps so it can consolidate memory and avoid duplication (see String.intern() ). That list makes sense to be static.
    On the other hand, the representation of the state of a board game should not be static, because someone could want to write a program which has multiple games within it - or you could within one game wish to have contingencies or undo-ability (essentially, it might not be as singleton as you think).
    Next, if you think the methods will ever need to be overridden, use a singleton, because static methods aren't, well, dynamic! (in case the singleton is a one-at-a-time singleton but it makes sense to have a change of identity over time).
    I have never written a true singleton - though often written classes which I did not PLAN on instantiating more than once.

  • Casting or Generics, which is better?

    Which is better for serialization <--> de-serialization?
    public class MyClass {
    private Object st;
    public MyClass (Object what) { st = what; }
    public Object get() {return st;}
    out.writeObject(new MyClass("This is a test"));
    Object ob =  in.readObject();
    if (ob instanceof String) {
      Sting result = (String) ob;
    }Or using Generics?
    public static final byte STRING_TYPE = 0x01;
    public class MyClass<T> {
    private T st;
    private byte type;
    public MyClass ( byte type, T what ) { st = what; this.type = type; }
    public T get() {return st;}
    public byte getType() {return type;}
    out.writeObject(new MyClass<String>(STRING_TYPE,"This is a test"));
    MyClass<?> value =  (MyClass<?>) in.readObject()
    if (value.getType() == STRING_VALUE) {
      MyClass<String> str = (MyClass<String>) value;
      Sting result = str.get();
    }Both have unchecked casts (at least according to Eclipse), it is better to cast the generic or just use casts and not use generics? The latter is more complicated but allows more flexibility, but which method is correct?

    CREATE TABLE `login` (
    `username` varchar(40) DEFAULT NULL,
    `password` varchar(40) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `amount` (
    `amountid` int(11) NOT NULL,
    `receiptid` int(11) DEFAULT NULL,
    `loanid` int(11) DEFAULT NULL,
    `amount` bigint(11) DEFAULT NULL,
    `latefee` int(11) DEFAULT NULL,
    `paymentid` int(11) DEFAULT NULL,
    `pid` int(11) DEFAULT NULL,
    PRIMARY KEY (`amountid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `applicationfee` (
    `applicationfeeid` int(11) DEFAULT NULL,
    `applicationamount` int(11) DEFAULT NULL,
    `applicationfee` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `category` (
    `categoryid` int(11) DEFAULT NULL,
    `categoryname` varchar(40) DEFAULT NULL,
    `categorydescription` varchar(500) DEFAULT NULL,
    `cattype` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `commission` (
    `commissionid` int(11) DEFAULT NULL,
    `bussiness` int(11) DEFAULT NULL,
    `commission` int(11) DEFAULT NULL,
    `pid` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `customer` (
    `cacno` int(11) NOT NULL DEFAULT '0',
    `name` varchar(40) DEFAULT NULL,
    `age` int(11) DEFAULT NULL,
    `cphone` varchar(40) DEFAULT NULL,
    `cmobile` varchar(40) DEFAULT NULL,
    `caddress` varchar(500) DEFAULT NULL,
    `cstatus` varchar(20) DEFAULT NULL,
    `cphoto` longblob,
    `pid` int(11) DEFAULT NULL,
    PRIMARY KEY (`cacno`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `daybook` (
    `closingbal` varchar(40) DEFAULT NULL,
    `date` date DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `extraincome` (
    `categoryid` int(11) NOT NULL,
    `receiptid` int(11) DEFAULT NULL,
    `date` date DEFAULT NULL,
    `amountid` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `employee` (
    `empno` int(11) DEFAULT NULL,
    `empname` varchar(40) DEFAULT NULL,
    `age` int(11) DEFAULT NULL,
    `sal` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `image` (
    `id` int(11) DEFAULT NULL,
    `image` blob
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `loan` (
    `loanid` int(11) NOT NULL DEFAULT '0',
    `loanamt` varchar(40) DEFAULT NULL,
    `payableamount` double DEFAULT NULL,
    `installment` int(11) DEFAULT NULL,
    `payableinstallments` int(11) DEFAULT NULL,
    `monthlyinstallment` varchar(20) DEFAULT NULL,
    `surityname` varchar(20) DEFAULT NULL,
    `applicationfeeid` int(11) DEFAULT NULL,
    `interestrate` float DEFAULT NULL,
    `issuedate` date DEFAULT NULL,
    `duedate` date DEFAULT NULL,
    `nextduedate` date DEFAULT NULL,
    `cacno` int(11) DEFAULT NULL,
    `cname` varchar(20) DEFAULT NULL,
    `pid` int(11) DEFAULT NULL,
    `interestamt` double DEFAULT NULL,
    `pendingamt` float DEFAULT NULL,
    PRIMARY KEY (`loanid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `md` (
    `mdid` int(11) NOT NULL DEFAULT '0',
    `mdname` varchar(40) DEFAULT NULL,
    `mdphoto` varchar(100) DEFAULT NULL,
    `mdphone` varchar(40) DEFAULT NULL,
    `mdmobile` varchar(40) DEFAULT NULL,
    `mdaddress` varchar(500) DEFAULT NULL,
    PRIMARY KEY (`mdid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `partner` (
    `pid` int(11) NOT NULL DEFAULT '0',
    `pname` varchar(40) DEFAULT NULL,
    `paddress` varchar(500) DEFAULT NULL,
    `pphoto` varchar(100) DEFAULT NULL,
    `pphone` varchar(40) DEFAULT NULL,
    `pmobile` varchar(40) DEFAULT NULL,
    `pstatus` varchar(20) DEFAULT NULL,
    `mdid` int(11) DEFAULT NULL,
    `mdname` varchar(40) DEFAULT NULL,
    `date` date DEFAULT NULL,
    `nextpaydate` date DEFAULT NULL,
    PRIMARY KEY (`pid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `partnerinvested` (
    `pid` int(11) DEFAULT NULL,
    `pname` varchar(20) DEFAULT NULL,
    `receiptid` int(11) DEFAULT NULL,
    `date` date DEFAULT NULL,
    `amountinvested` int(11) DEFAULT NULL,
    `latefee` int(11) DEFAULT NULL,
    `amountid` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `payments` (
    `paymentid` int(11) NOT NULL,
    `categoryid` int(11) DEFAULT NULL,
    `particulars` varchar(100) DEFAULT NULL,
    `amountid` int(11) DEFAULT NULL,
    `paymentdate` date DEFAULT NULL,
    PRIMARY KEY (`paymentid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `receipts` (
    `receiptid` int(11) DEFAULT NULL,
    `paiddate` date DEFAULT NULL,
    `amountid` int(11) DEFAULT NULL,
    `loanid` int(11) DEFAULT NULL,
    `latefee` int(11) DEFAULT NULL,
    `installment` int(11) DEFAULT NULL,
    `cacno` int(11) DEFAULT NULL,
    `cname` varchar(40) DEFAULT NULL,
    `pid` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

  • Better technique null values

    Which is better, from the following?
    if method
    String studentIdParam = request.getParameter("studentId");
    long studentId = 0
    if(studentIdParam !=null)
        studentId = Long.parseLong(studentIdParam);exception method
    long studentId = 0;
    try{
       studentId = Long.parseLong(request.getParameter("studentId");
    }Exception e{}

    aksarben wrote:
    If a null student ID is harmless, i might be tempted to go with Door number 1.In both options, studentID is declared 0 (which may/may not change depending on the request parameter), so if a studentID of 0 is harmless then sure.
    Personally, I wouldn't use either. I would either declare the long studentID inside the try/catch block, or if it needed to be in a bigger scope, I'd declare it outside but not initialize it and do my null checks as needed.

  • Which is better to use: BEx query or Web Application as an iView in portal?

    Hi gurus!
    Are there any experienced opinions, which is better - publish a BEx query in portal or publish a BEx Web Application in portal? Is it easier to alter the layout attributes etc. if I create a BEx Web Application first before publishing?
    What is the way of fixing for example filter item height if I publish BEx query in portal - is there a Web Application that it uses anyhow which I can fix? Or can I use in that case iView -properties in portal?
    Thankful for advice
    Sari

    ok, means i can use jsp:useBean tag for all my
    classes that are not actually bean. so it will be
    instantiated at run time and provide efficiency .No. Jsp:useBean is used for java bean components.
    >
    but when should i use import statement in my jsp and
    it happen at translation time so will it create any
    type of burden for my code if i import multiple
    classes.For non-java beans, you need to import the classes, period.
    It's not a burden, it's a necessity.

  • Which is better for bulk message scenario in sap xi RFC or Proxy

    which is better for bulk message scenario in ( RFC or Proxy ) ?
    Edited by: prabhatxi on Aug 6, 2010 4:44 PM

    Proxy will alwaays be better option in this case, as it is adapter less framework, and communication happens directly with XI central integration engine. So it is always fast communication and gives good performance.
    But still you should consider other factors, you may consider using RFC as well, as sometime we go for RFC/IDOC as this are the standard interfaces already available rather than creating structure...
    May be you can share more info on what type/volume data are you planning to send via XI?
    Hope this cleart your doubt..
    Divyesh

Maybe you are looking for

  • Missing Links in InDesign CS3

    We are using InDesign CS3 and the program itself works good, the problem I'm having is all our data is located on a server and I have replaced the server with a new one, now when we open a document it has missing links and it takes forever searching

  • Mini DVI to HDMI cables- Will I get audio on TV

    If I hook up a mini DVI to HDMI adapter to an HDMI cable and run it from my MacBook to my plasma TV, can I get video & audio without using the optical digital audio port?

  • SAPLPD problem on cluster

    Hello experts, On our BI 7.0 system, we have our Dev and QA environments on single servers. However, for the Production system we use Microsoft Clustering (MSCS). I am not sure if my problem is related to the cluster architecture at all, but I am hav

  • Quick Time Pro Not Installing

    I enter the registration key that I have with the name, and the only thing that comes open is QuickTime Player. The Quicktime Pro just isn't there. I see QT Pro in the registration window, but player is the only thing that opens. What gives?

  • Can you have multiple RMI Servers listen at the same port?

    Hi, I am wondering if is possible to assign many RMI servers to the same port. I have a working RMI system that is assigning a single server to a specified port when the server is created. I need to scale my project to incorporate Activation and the