Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8828421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:36:10+00:00 2026-06-14T07:36:10+00:00

for statement rs.getString(name) //rs is java.sql.ResultSet interface bytecode is: 41: aload 4 43: ldc

  • 0

for statement

rs.getString("name")  //rs is java.sql.ResultSet interface

bytecode is:

41:  aload   4
43:  ldc     #10; //String name
45:  invokeinterface #11,  2; //InterfaceMethod java/sql/ResultSet.getString:(Ljava/lang/String;)Ljava/lang/String;
50:  pop

At line 45 returned string object by rs.getString("name") is pushed onto stack and at line 50, return object (a string object) is poped up.

1)Does stack contain only reference to this returned string object with actual object on heap OR stack contains the actual String object??

2) and after poping up the returned string object, will it be garbage collected OR it’s memory deallocated as stack for this method vanishes???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:36:12+00:00Added an answer on June 14, 2026 at 7:36 am

    At line 45 returned string object by rs.getString(“name”) is pushed onto stack

    There is no returned string object. There’s a returned string reference.

    Conceptually at least, objects are never on the stack, never returned, never passed. It’s only ever a reference.

    and after poping up the returned string object, will it be garbage collected OR it’s memory deallocated as stack for this method vanishes?

    The reference will be cleared when the stack pops, which means that the string object itself would be eligible for garbage collection if there are no other strong references to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; class test{ def selectAuther(){
import java.awt.Panel; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement;
I build this webservice on netbeans, package in.figures.on.mobile; import db.koneksi.dbKoneksi; import java.sql.Statement; import java.sql.ResultSet;
Statement st=null; ResultSet rs=null; Connection con=null; String sql=select * from employee;; try{ con= new
I have the following prepared statement for sql in Java : com.mysql.jdbc.JDBC4PreparedStatement@6e56103e: INSERT INTO
i have a java class :: package MyPackage; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet;
<%@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1%> <%@page import=java.sql.*%><%@page import = java.sql.ResultSet %> <%@page import
How can I get oracle XMLElement to JDBC? java.sql.Statement st = connection.createStatement(); // works
What is wrong with this statement? return Encoding.ASCII.GetString(memoryStream.GetBuffer(), 0, memoryStream.Length) I know about the
I am getting error in the sql statement. (server= RAJ-PC\SQLEXPRESS; user id=sa; password=as64ws; database=onlineshopping,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.